[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200703160351.l2G3p3GJ020217@turing-police.cc.vt.edu>
Date: Thu, 15 Mar 2007 23:51:03 -0400
From: Valdis.Kletnieks@...edu
To: Rik van Riel <riel@...hat.com>
Cc: Andreas Mohr <andi@...x01.fht-esslingen.de>,
Dave Kleikamp <shaggy@...ux.vnet.ibm.com>,
Ashif Harji <asharji@...uwaterloo.ca>, linux-mm@...ck.org,
Nick Piggin <npiggin@...e.de>, Jan Kara <jack@...e.cz>,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed
On Thu, 15 Mar 2007 14:35:17 EDT, Rik van Riel said:
> Valdis.Kletnieks@...edu wrote:
> > On Wed, 14 Mar 2007 22:33:17 BST, Andreas Mohr said:
> >
> >> it'd seem we need some kind of state management here to figure out good
> >> intervals of when to call mark_page_accessed() *again* for this page. E.g.
> >> despite non-changing access patterns you could still call mark_page_accessed()
> >> every 32 calls or so to avoid expiry, but this would need extra helper
> >> variables.
> >
> > What if you did something like
> >
> > if (jiffies%32) {...
> >
> > (Possibly scaling it so the low-order bits change). No need to lock it, as
> > "right most of the time" is close enough.
>
> Bad idea. That way you would only count page accesses if the
> phase of the moon^Wjiffie is just right.
On the other hand, Andreas suggested only marking it once every 32 calls,
but that required a helper variable. Statistically, jiffies%32 should
end up about the same as a helper variable %32.
This of course, if just calling mark_page_accessed() is actually expensive
enough that we don't want to do it unconditionally.
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists