[lkml]   [2002]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Race in shrink_cache
On Thursday 05 September 2002 09:07, Andrew Morton wrote:
> Daniel Phillips wrote:
> >
> > ...
> > /*
> > * We must not allow an anon page
> > * with no buffers to be visible on
> > * the LRU, so we unlock the page after
> > * taking the lru lock
> > */
> >
> > That is, what's scary about an anon page without buffers?
> ooop. That's an akpm comment. umm, err..
> It solves this BUG:
> Around the 2.4.10 timeframe, Andrea started putting anon pages
> on the LRU. Then he backed that out, then put it in again. I
> think this comment dates from the time when anon pages were
> not on the LRU. So there's a little window there where the
> page is unlocked, we've just dropped its swapdev buffers, the page is
> on the LRU and pagemap_lru_lock is not held.
> So another CPU came in, found the page on the LRU, saw that it had
> no ->mapping and no ->buffers and went BUG.
> The fix was to take pagemap_lru_lock before unlocking the page.
> The comment is stale.

With the atomic_dec_and_lock strategy, the page would be freed immediately on
the buffers being released, and with the lru=1 strategy it doesn't matter
in terms of correctness whether the page ends up on the lru or not, so I was
inclined not to worry about this anyway, still, when you a dire-looking
comment like that...

You said something about your lru locking strategy in 2.5.33-mm2. I have not
reverse engineered it yet, would you care to wax poetic?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.204 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site