Messages in this thread | | | From | Nikita Danilov <> | Date | Wed, 15 Jun 2005 15:29:15 +0400 | Subject | Re: 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/
| |