Re: [PATCH] swap writepages swizzled

Andrew Morton (akpm@digeo.com)
Mon, 11 Nov 2002 11:14:57 -0800


Hugh Dickins wrote:
>
> ...
> optional patch
> to try_to_free_buffers, once upon a time swap came that way,
> happily ever after it doesn't, so the test seems misleading.
>

Alas, swapcache pages can still have buffers attached.

It's pretty rare. Suppose an application has paged in a page from
an ext3 file. It is sleeping on the completion of the read. Now,
the file is ftruncated. Pagetables are torn down and truncate_inode_pages
tries to throw away the pagecache. But the particular page which is
being faulted in has an elevated refcount, so it is not succesfully
freed by truncate. It _is_ removed from pagecache.

The page is instantiated in the faulter's pagetables as an anonymous
page just floating out there somewhere.

It doesn't have its buffers removed either, because it was attached
to an ext3 transaction at the time of the truncate, and try_to_release_page()
failed.

We end up with an anonymous, swappable page which has buffers.

So we need to keep that test.
-
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/