Re: [PATCH] page->flags corruption fix

From: Rik van Riel
Date: Wed Oct 08 2003 - 10:11:36 EST


On Wed, 8 Oct 2003, David S. Miller wrote:
> On Wed, 8 Oct 2003 15:49:34 +0100 (BST)
> Hugh Dickins <hugh@xxxxxxxxxxx> wrote:
>
> > Seven atomic ops in a row, isn't that rather inefficient?

Absolutely.

> > Is there an actual test case for why 2.4 now needs this change?
>
> It's not a new bug, we've always had this bug in 2.4.x

Though I suspect it's gotten worse since 2.4.14 or so, where
we moved the final lru_cache_del() into __free_pages_ok() and
the fact that anonymous pages are on the lru lists.

It's quite possible that one CPU adds the page to the swap
cache, while another CPU moves the page around on the inactive
list. At that point both CPUs could be fiddling around with
the page->flags simultaneously.

In fact, this has been observed in heavy stress testing by
Matt Domsch and Robert Hentosh...

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/