Re: VM: Fix nasty and subtle race in shared mmap'ed page writeback

From: Christoph Lameter
Date: Fri Jan 05 2007 - 14:13:13 EST


On Wed, 3 Jan 2007, Linus Torvalds wrote:

> And I haven't actually thought about it that much, so I could be full of
> crap. But I don't see anything that protects against it: we may hold the
> page lock, but since the code that marks things _dirty_ doesn't
> necessarily always hold it, that doesn't help us. And we may hold the
> "private_lock", but we drop it before we do the dirty bit clearing, and in
> fact on UP+PREEMPT that very dropping could cause an active preemption to
> take place, so..

Maybe we should require taking the page lock before the dirty bits are
modified? That way we can avoid all the artistic code in there right now.
It may be even become comprehensible. The page lock and the dirty bit use
the same cacheline (same word actually), contention is rare and so there
is likely only a negligible performance impact.
-
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/