lkml.org 
[lkml]   [2005]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: one question about LRU mechanism
    liyu@LAN writes:

    [...]

    >
    > /************************************************************/
    > while (scan++ < nr_to_scan && !list_empty(src)) {
    > page = lru_to_page(src);
    > prefetchw_prev_lru_page(page, src, flags);
    >
    > if (!TestClearPageLRU(page))
    > BUG();
    > list_del(&page->lru);

    [...]

    >
    > /***************************************************/
    > while (scan++ < nr_to_scan && !list_empty(src->prev)) {

    list_empty(something) and list_empty(something->prev) are equivalent for
    well-formed lists.

    list_empty(src) check in isolate_lru_pages() is for pathological case
    when active list becomes empty. Also active and inactive lists are not
    LRU, they are closer to second-chance-FIFO, it is _together_ that they
    emulate LRU.

    Nikita.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-06-15 13:34    [W:0.020 / U:30.496 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site