linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: nishimura@mxp.nes.nec.co.jp,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"xemul@openvz.org" <xemul@openvz.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"kosaki.motohiro@jp.fujitsu.com" <kosaki.motohiro@jp.fujitsu.com>,
	"hugh@veritas.com" <hugh@veritas.com>
Subject: Re: [mmtom] please drop memcg-handle-swap-cache set (memcg handle swap cache rework).
Date: Fri, 18 Jul 2008 17:26:54 +0900	[thread overview]
Message-ID: <20080718172654.109018db.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20080718152232.31d36e0b.kamezawa.hiroyu@jp.fujitsu.com>

> > > @@ -398,12 +395,27 @@ static void migrate_page_copy(struct pag
> > >   	}
> > >  
> > >  #ifdef CONFIG_SWAP
> > > -	ClearPageSwapCache(page);
> > > +	if (PageSwapCache(page)) {
> > > +		/*
> > > +		 * SwapCache is removed implicitly. To uncharge SwapCache,
> > > +		 * SwapCache flag should be cleared.
> > > +		 */
> > > +		ClearPageSwapCache(page);
> > > +		mem_cgroup_uncharge_page(page);
> > > +	}
> > >  #endif
> > >  	ClearPageActive(page);
> > >  	ClearPagePrivate(page);
> > >  	set_page_private(page, 0);
> > > -	page->mapping = NULL;
> > > +
> > > +	if (!PageAnon(page)) {
> > > +		/*
> > > +		 * This page was removed from radix-tree implicitly.
> > > +		 */
> > > +		page->mapping = NULL;
> > > +		mem_cgroup_uncharge_cache_page(page);
> > > +	} else
> > > +		page->mapping = NULL;
> > >  
> > 
> > page->mapping will be cleared anyway, so I prefer:
> > 
> > ===
> > 	page->mapping = NULL;
> > 
> > 	if (!PageAnon(page))
> > 		/*
> > 		 * This page was removed from radix-tree implicitly.
> > 		 */
> > 		mem_cgroup_uncharge_cache_page(page);
> > ===
> > 
> Ah.., PageAnon(page) check (page->mapping & 0x1) so, we cant do this.
> 
Ooops! Sorry for saying stupid thing.

> Hmm, like this ?
> ==
> anon = PageAnon(page);
> page->mapping = NULL;
> if (anon)
> 	mem_cgroup_....
> ==
> 
Looks good.
But I don't have any objection to your original code.
I just thought 2 lines of "page->mapping = NULL" was verbose.


Thanks,
Daisuke Nishimura.

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-07-18  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17  3:45 KAMEZAWA Hiroyuki
2008-07-18  5:15 ` Daisuke Nishimura
2008-07-18  6:22   ` KAMEZAWA Hiroyuki
2008-07-18  8:26     ` Daisuke Nishimura [this message]
2008-07-20 23:44 ` Balbir Singh
2008-07-28  8:22 ` kamezawa.hiroyu

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=20080718172654.109018db.nishimura@mxp.nes.nec.co.jp \
    --to=nishimura@mxp.nes.nec.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=hugh@veritas.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=xemul@openvz.org \
    /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