Messages in this thread | | | From | Nikita Danilov <> | Date | Thu, 19 Jan 2006 20:48:52 +0300 | Subject | Re: [patch 2/4] mm: PageLRU no testset |
| |
Nick Piggin writes: > PG_lru is protected by zone->lru_lock. It does not need TestSet/TestClear > operations. > > Signed-off-by: Nick Piggin <npiggin@suse.de> > > Index: linux-2.6/mm/vmscan.c > =================================================================== > --- linux-2.6.orig/mm/vmscan.c > +++ linux-2.6/mm/vmscan.c > @@ -775,9 +775,10 @@ int isolate_lru_page(struct page *page) > if (PageLRU(page)) { > struct zone *zone = page_zone(page); > spin_lock_irq(&zone->lru_lock); > - if (TestClearPageLRU(page)) { > + if (PageLRU(page)) { > ret = 1; > get_page(page); > + ClearPageLRU(page);
Why is that better? ClearPageLRU() is also "atomic" operation (in the sense of using LOCK_PREFIX on x86), so it seems this change strictly adds cycles to the hot-path when page is on 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/
| |