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

David S. Miller
2002-07-29T06:18:21Z

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

[ This is Linus speaking in all the quoted material below... ]

> 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.
...
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.

[ Now DaveM is talking :-) ]

So let's say that we have a page going out a socket. The socket's FD
has multiple references so when the user exit()'s the anonymous page
is still "in-flight" but the socket isn't closed and thus we won't
wait for the write to complete.

So when the user's reference is dropped, does that operation kill it
from the LRU or will the socket's remaining reference to that page
defer the LRU removal?