Re: one question about LRU mechanism

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux