linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
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>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [PATCH] memcg: clean up migration
Date: Mon, 28 Feb 2011 11:40:06 +0900	[thread overview]
Message-ID: <20110228114006.89177ce7.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <AANLkTik44K60MLTw_m431xd3ZFatAo=9O+42jUHscdFR@mail.gmail.com>

> >> @@ -678,13 +675,11 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
> >> A  A  A  }
> >>
> >> A  A  A  /* charge against new page */
> >> - A  A  charge = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
> >> - A  A  if (charge == -ENOMEM) {
> >> - A  A  A  A  A  A  rc = -ENOMEM;
> >> + A  A  rc = mem_cgroup_prepare_migration(page, newpage, &mem, GFP_KERNEL);
> >> + A  A  if (rc)
> >> A  A  A  A  A  A  A  goto unlock;
> >> - A  A  }
> >> - A  A  BUG_ON(charge);
> >>
> >> + A  A  rc = -EAGAIN;
> >> A  A  A  if (PageWriteback(page)) {
> >> A  A  A  A  A  A  A  if (!force || !sync)
> >> A  A  A  A  A  A  A  A  A  A  A  goto uncharge;
> > How about
> >
> > A  A  A  A if (mem_cgroup_prepare_migration(..)) {
> > A  A  A  A  A  A  A  A rc = -ENOMEM;
> > A  A  A  A  A  A  A  A goto unlock;
> > A  A  A  A }
> >
> > ?
> >
> > Re-setting "rc" to -EAGAIN is not necessary in this case.
> > "if (mem_cgroup_...)" is commonly used in many places.
> >
> It works now but Johannes doesn't like it and me, either.
> It makes unnecessary dependency which mem_cgroup_preparre_migration
> can't propagate error to migrate_pages.
> Although we don't need it, I want to remove such unnecessary dependency.
> 
I see.
Thank you for your explanation.

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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2011-02-28  2:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 15:49 Minchan Kim
2011-02-27 21:09 ` Johannes Weiner
2011-02-27 23:38   ` Minchan Kim
2011-02-28  0:55 ` KAMEZAWA Hiroyuki
2011-02-28  2:18 ` Daisuke Nishimura
2011-02-28  2:35   ` Minchan Kim
2011-02-28  2:40     ` Daisuke Nishimura [this message]

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=20110228114006.89177ce7.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=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.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