Re: [patch] 2.2.0-pre5 FreeAfter() check missing

Stephen C. Tweedie (sct@redhat.com)
Mon, 11 Jan 1999 17:28:12 GMT


Hi,

On Fri, 8 Jan 1999 11:08:18 -0800 (PST), Linus Torvalds
<torvalds@transmeta.com> said:

> I hate the is_shared() function, and part of that is exactly because of
> this. I looked at the code, and for the life of me I could not _prove_
> that it was always safe to just ignore the fact that we're busy using the
> page for IO. So the 2.2.0-pre5 behaviour is actually on purpose.

Yep, but unfortunately there is simply no other test available to us to
tell us how many mappings share the page. For things like COW, we
_need_ that.

The only reason we can get away with it is that a false positive in
is_page_shared() is harmless. A false negative would be disasterous
(we'd end up with writabe sharings of COW pages after a fork, leading to
applications corrupting each others' memory).

As long as the mapping count is embedded in the page reference count, we
will not be able to rely on is_page_shared() 100%.

--Stephen

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