On Tue, 18 Apr 2000, Stephen C. Tweedie wrote:
>Are you sure it's safe to be removing the page from the lru lists even
>if the page is actively in use by another process? That's what
>truncate_inode_pages can do --- it doesn't check the page refcount
>before discarding it.
It believe it's safe because the page is not a part of the cache anymore
anyway (we do unconditional remove_inode_page) and so keeping the page
into the lru would be wrong (unless there are still busy buffers in it and
in such case we keep it, and btw I think it can't happen there are still
buffers on it). It's ok in the same way it's ok that a page non inside the
page cache is still referenced by page cache users. The users will do a
free_page soon after looking at the pte and they won't bother about the
kind of the page.
We serialize with shrink_mmap increasing the page count inside the
pagecache_lock critical section so shrink_mmap isn't an issue for
truncate_inode_pages.
I think invalidate_inode_pages() isn't yet fully safe w.r.t. shrink_mmap
but that's another issue. I think invalidate_inode_pages() could left some
page to free by shrink_mmap but we have no garantee on _when_ shrink_mmap
will get rid of such pages right now... That's not trivial issue.
Andrea
-
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/
This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:14 EST