Re: [PATCH 1/3] Fix COW D-cache aliasing on fork

From: Nick Piggin
Date: Fri Oct 20 2006 - 12:48:42 EST


Linus Torvalds wrote:

On Sat, 21 Oct 2006, Nick Piggin wrote:

I didn't think that would work if there is no TLB. But if the writeback
can cause a TLB reload, and then bypass the readonly protection, then
yes would close all races.


On the other hand, doing the cache flush at COW time is "kind of equivalent" to just doing it after the TLB flush. It's now just _much_ after the flush ;)

So maybe the COW D$ aliasing patch-series is just the right thing to do. Not worry about D$ at _all_ when doing the actual fork, and only worry about it on an actual COW event. Hmm?

Well if we have the calls in there, we should at least make them work
right for the architectures there now. At the moment the flush_cache_mm
before the copy_page_range wouldn't seem to do anything if you can still
have threads dirty the cache again through existing TLB entries.

I don't think that flushing on COW is exactly right though, because dirty
data can remain invisible if you're only doing reads (no write, no flush).
And if that cache gets written back at some point, you're going to see
supposedly RO data change underneath you. I think?

--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com -
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/