Re: [PATCH 06/41] FS-Cache: Recruit a page flags for cache management [ver #48]

From: Nick Piggin
Date: Sat Apr 04 2009 - 02:05:14 EST


And frame changelogs like this as what the patch is actually doing.

mm: add another page bit to signal fs private data

Add a new flag PG_private_2 which, similarly to PG_private, instructs
the mm to call into the fs when releasing or invalidating the page.

fscache will use this for blah blah blah.


> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -283,7 +283,7 @@ static inline int page_mapping_inuse(struct page *page)
>
> static inline int is_page_cache_freeable(struct page *page)
> {
> - return page_count(page) - !!PagePrivate(page) == 2;
> + return page_count(page) - !!page_has_private(page) == 2;
> }
>
> static int may_write_to_queue(struct backing_dev_info *bdi)

What if the page has both private bits set? Will this count for 2 references?
If not, that's unintuitive and needs commenting somewhere so nobody else who
might use this bit will end up with memory leaks. If so, then you need to
modify this check to account for both possible references.
--
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/