lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 07 Feb 2011 10:37:01 +0100
From:	Miklos Szeredi <mszeredi@...e.cz>
To:	Minchan Kim <minchan.kim@...il.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-mm <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Rik van Riel <riel@...hat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	Mel Gorman <mel@....ul.ie>
Subject: Re: [PATCH] mm: Add hook of freepage

On Mon, 2011-02-07 at 00:08 +0900, Minchan Kim wrote:
> Recently, "Call the filesystem back whenever a page is removed from
> the page cache(6072d13c)" added new freepage hook in page cache
> drop function.
> 
> So, replace_page_cache_page should call freepage to support
> page cleanup to fs.

Thanks Minchan for fixing this.

Acked-by: Miklos Szeredi <mszeredi@...e.cz>

> 
> Cc: Miklos Szeredi <mszeredi@...e.cz>
> Cc: Rik van Riel <riel@...hat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
> Cc: Mel Gorman <mel@....ul.ie>
> Signed-off-by: Minchan Kim <minchan.kim@...il.com>
> ---
>  mm/filemap.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 3c89c96..a25c898 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -436,7 +436,10 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
>  	error = radix_tree_preload(gfp_mask & ~__GFP_HIGHMEM);
>  	if (!error) {
>  		struct address_space *mapping = old->mapping;
> +		void (*freepage)(struct page *);
> +
>  		pgoff_t offset = old->index;
> +		freepage = mapping->a_ops->freepage;
>  
>  		page_cache_get(new);
>  		new->mapping = mapping;
> @@ -452,6 +455,8 @@ int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)
>  			__inc_zone_page_state(new, NR_SHMEM);
>  		spin_unlock_irq(&mapping->tree_lock);
>  		radix_tree_preload_end();
> +		if (freepage)
> +			freepage(old);
>  		page_cache_release(old);
>  		mem_cgroup_end_migration(memcg, old, new, true);
>  	} else {


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ