Re: FS-Cache: Handle pages pending storage that get evicted under OOM conditions

From: Stefan Lippers-Hollmann
Date: Tue Dec 01 2009 - 08:11:28 EST


Hi

On Tuesday 01 December 2009, Linux Kernel Mailing List wrote:
> Gitweb: http://git.kernel.org/linus/201a15428bd54f83eccec8b7c64a04b8f9431204
> Commit: 201a15428bd54f83eccec8b7c64a04b8f9431204
> Parent: e3d4d28b1c8cc7c26536a50b43d86ccd39878550
> Author: David Howells <dhowells@xxxxxxxxxx>
> AuthorDate: Thu Nov 19 18:11:35 2009 +0000
> Committer: David Howells <dhowells@xxxxxxxxxx>
> CommitDate: Thu Nov 19 18:11:35 2009 +0000
>
> FS-Cache: Handle pages pending storage that get evicted under OOM conditions
>
> Handle netfs pages that the vmscan algorithm wants to evict from the pagecache
> under OOM conditions, but that are waiting for write to the cache. Under these
> conditions, vmscan calls the releasepage() function of the netfs, asking if a
> page can be discarded.
[...]

This commit breaks compiling 9p in 2.6.32-rc8-git2:

CC [M] fs/9p/cache.o
fs/9p/cache.c: In function '__v9fs_fscache_release_page':
fs/9p/cache.c:346: error: 'vnode' undeclared (first use in this function)
fs/9p/cache.c:346: error: (Each undeclared identifier is reported only once
fs/9p/cache.c:346: error: for each function it appears in.)
make[2]: *** [fs/9p/cache.o] Error 1

> diff --git a/fs/9p/cache.c b/fs/9p/cache.c
> index 51c94e2..bcc5357 100644
> --- a/fs/9p/cache.c
> +++ b/fs/9p/cache.c
> @@ -343,18 +343,7 @@ int __v9fs_fscache_release_page(struct page *page, gfp_t gfp)
>
> BUG_ON(!vcookie->fscache);
>
> - if (PageFsCache(page)) {
> - if (fscache_check_page_write(vcookie->fscache, page)) {
> - if (!(gfp & __GFP_WAIT))
> - return 0;
> - fscache_wait_on_page_write(vcookie->fscache, page);
> - }
> -
> - fscache_uncache_page(vcookie->fscache, page);
> - ClearPageFsCache(page);
> - }
> -
> - return 1;
> + return fscache_maybe_release_page(vnode->cache, page, gfp);
> }
>
[...]

Regards
Stefan Lippers-Hollmann



9p: fix build failure introduced by 201a15428bd54f83eccec8b7c64a04b8f9431204

CC [M] fs/9p/cache.o
fs/9p/cache.c: In function '__v9fs_fscache_release_page':
fs/9p/cache.c:346: error: 'vnode' undeclared (first use in this function)
fs/9p/cache.c:346: error: (Each undeclared identifier is reported only once
fs/9p/cache.c:346: error: for each function it appears in.)
make[2]: *** [fs/9p/cache.o] Error 1

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@xxxxxx>
---
build tested only.

fs/9p/cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index bcc5357..e777961 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -343,7 +343,7 @@ int __v9fs_fscache_release_page(struct page *page, gfp_t gfp)

BUG_ON(!vcookie->fscache);

- return fscache_maybe_release_page(vnode->cache, page, gfp);
+ return fscache_maybe_release_page(vcookie->fscache, page, gfp);
}

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