lkml.org 
[lkml]   [2006]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/4] mm: PageLRU no testset
On Thu, Jan 19, 2006 at 08:48:52PM +0300, Nikita Danilov wrote:
> 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.
>

Less restrictive memory ordering requirements.

Nick

-
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: 2006-01-19 19:14    [W:0.032 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site