linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <mszeredi@suse.cz>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Rik van Riel <riel@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Mel Gorman <mel@csn.ul.ie>
Subject: Re: [PATCH] mm: Add hook of freepage
Date: Mon, 07 Feb 2011 10:37:01 +0100	[thread overview]
Message-ID: <1297071421.25994.58.camel@tucsk.pomaz.szeredi.hu> (raw)
In-Reply-To: <1297004934-4605-1-git-send-email-minchan.kim@gmail.com>

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@suse.cz>

> 
> Cc: Miklos Szeredi <mszeredi@suse.cz>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-02-07  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-06 15:08 Minchan Kim
2011-02-06 20:20 ` Rik van Riel
2011-02-07  9:37 ` Miklos Szeredi [this message]
2011-02-08  1:28   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297071421.25994.58.camel@tucsk.pomaz.szeredi.hu \
    --to=mszeredi@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@gmail.com \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox