Re: [patch 2/13] remove pages from the LRU in __free_pages_ok()

Linus Torvalds (torvalds@transmeta.com)
Sun, 28 Jul 2002 23:16:24 -0700 (PDT)


On Sun, 28 Jul 2002, David S. Miller wrote:
>
> But the thing is, nobody should normally have a reference to such a
> page anyway. The only way they happen is by something mapping a
> page from user space, and saving it away, while the user space goes
> away and drops its references to the page.
>
> Ignoring for a moment whether you agree with the idea of zero-copying
> userspace pages over sockets, I would at least like to retain the
> ability to experiment with something like this.

Oh, you misunderstand.. (probably because I'm unclear)

I'm not saying that getting a page from a user space mapping is bad: a lot
of places do that independently of zero-copy.

But hopefully nobody should have the problematic last reference to a LRU
page _except_ the user space itself. That should be safe for page cache
pages thanks to the truncate change.

And for anonymous pages, I really think that the right solution is to do
the same remove-from-LRU thing for the "last unmap" (which should be
trivial to notice with rmap).

I'm trying to come up with what kept us safe in 2.4.x for anonymous pages,
and I get this sinking feeling that we really aren't.

Which may imply that Andrew's irq-safe LRU list is the right thing to do
after all. At least on 2.4.x (and if you do it there, then my arguments
about it being unnecessary on 2.5.x due to "design" just totally cruble
away, since clearly Andrew was rigth and the "design argument" was total
crud.

Let me sleep on this. Does anybody have any intelligent thoughts?

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/