Re: pre12 VM doubts and patch

Linus Torvalds (torvalds@transmeta.com)
Wed, 19 Sep 2001 23:15:47 -0700 (PDT)


On Thu, 20 Sep 2001, Andrea Arcangeli wrote:
>
> hmm, the stuff inside #if 0 doesn't seem to be correct either there,
> write_access doesn't mean we have the right to write to it, it just mean
> we're trying to.

No, write_access means not only that we are trying to write to it, but it
(by implication) means that we have the right too - otherwise we would
have SIGSEGV'd.

Anyway, I'm not at all sure that the write_access test is worth it, we
could just never do it (like your patch), or we could test if we allow COW
and do early COW (which the write-access kind of means).

However, your patch isn't right for another reason: if we do delete it
from the swap cache, we'd better mark it dirty so that it gets
re-allocated a swap entry if it later on needs it.

That's why the old code went to such extremes: it marked it dirty and
writable if it was a write access (and exclusive), and it marked it _just_
dirty and removed it from the swap cache if it went over the swap limit.

Whether that complexity is worth it, I don't know.

Linus

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