linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ying Han <yinghan@google.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Minchan Kim <minchan.kim@gmail.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Tejun Heo <tj@kernel.org>, Pavel Emelyanov <xemul@openvz.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Li Zefan <lizf@cn.fujitsu.com>, Mel Gorman <mel@csn.ul.ie>,
	Christoph Lameter <cl@linux.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>,
	Michal Hocko <mhocko@suse.cz>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Zhu Yanhai <zhu.yanhai@gmail.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH V7 7/9] Per-memcg background reclaim.
Date: Fri, 22 Apr 2011 11:37:43 -0700	[thread overview]
Message-ID: <BANLkTinB5tGAH=DE55HnE5krGxx1uoXgLA@mail.gmail.com> (raw)
In-Reply-To: <20110422174554.71F2.A69D9226@jp.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 3428 bytes --]

On Fri, Apr 22, 2011 at 1:44 AM, KOSAKI Motohiro <
kosaki.motohiro@jp.fujitsu.com> wrote:

> > > > @@ -111,6 +113,8 @@ struct scan_control {
> > > >        * are scanned.
> > > >        */
> > > >       nodemask_t      *nodemask;
> > > > +
> > > > +     int priority;
> > > >  };
> > >
> > > Bah!
> > > If you need sc.priority, you have to make cleanup patch at first. and
> > > all current reclaim path have to use sc.priority. Please don't increase
> > > unnecessary mess.
> > >
> > > hmm. so then I would change it by passing the priority
> > > as separate parameter.
>
> ok.
>
> > > > +             /*
> > > > +              * If we've done a decent amount of scanning and
> > > > +              * the reclaim ratio is low, start doing writepage
> > > > +              * even in laptop mode
> > > > +              */
> > > > +             if (total_scanned > SWAP_CLUSTER_MAX * 2 &&
> > > > +                 total_scanned > sc->nr_reclaimed + sc->nr_reclaimed
> /
> > > 2) {
> > > > +                     sc->may_writepage = 1;
> > >
> > > please make helper function for may_writepage. iow, don't cut-n-paste.
> > >
> > > hmm, can you help to clarify that?
>
> I meant completely cut-n-paste code and comments is here.
>
>
> > > > +     total_scanned = 0;
> > > > +
> > > > +     do_nodes = node_states[N_ONLINE];
> > >
> > > Why do we need care memoryless node? N_HIGH_MEMORY is wrong?
> > >
> > hmm, let me look into that.
>
>
> > > > +             sc.priority = priority;
> > > > +             /* The swap token gets in the way of swapout... */
> > > > +             if (!priority)
> > > > +                     disable_swap_token();
> > >
> > > Why?
> > >
> > > disable swap token mean "Please devest swap preventation privilege from
> > > owner task. Instead we endure swap storm and performance hit".
> > > However I doublt memcg memory shortage is good situation to make swap
> > > storm.
> > >
> >
> > I am not sure about that either way. we probably can leave as it is and
> make
> > corresponding change if real problem is observed?
>
> Why?
> This is not only memcg issue, but also can lead to global swap ping-pong.
>
> But I give up. I have no time to persuade you.
>
> Thank you for pointing that out. I didn't pay much attention on the
swap_token but just simply inherited
it from the global logic. Now after reading a bit more, i think you were
right about it.  It would be a bad
idea to have memcg kswapds affecting much the global swap token being set.

I will remove it from the next post.

>
> > > > +                     nid = mem_cgroup_select_victim_node(mem_cont,
> > > > +                                                     &do_nodes);
> > > > +
> > > > +                     pgdat = NODE_DATA(nid);
> > > > +                     shrink_memcg_node(pgdat, order, &sc);
> > > > +                     total_scanned += sc.nr_scanned;
> > > > +
> > > > +                     for (i = pgdat->nr_zones - 1; i >= 0; i--) {
> > > > +                             struct zone *zone = pgdat->node_zones +
> i;
> > > > +
> > > > +                             if (populated_zone(zone))
> > > > +                                     break;
> > > > +                     }
> > >
> > > memory less node check is here. but we can check it before.
> >
> > Not sure I understand this, can you help to clarify?
>
> Same with above N_HIGH_MEMORY comments.
>

Ok, agree on the HIGH_MEMORY and will change that.

--Ying

[-- Attachment #2: Type: text/html, Size: 4841 bytes --]

  reply	other threads:[~2011-04-22 18:37 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22  4:24 [RFC PATCH V7 0/9] memcg: per cgroup background reclaim Ying Han
2011-04-22  4:24 ` [PATCH V7 1/9] Add kswapd descriptor Ying Han
2011-04-22  4:31   ` KAMEZAWA Hiroyuki
2011-04-22  4:47   ` KOSAKI Motohiro
2011-04-22  5:55     ` Ying Han
2011-04-22  4:24 ` [PATCH V7 2/9] Add per memcg reclaim watermarks Ying Han
2011-04-22  4:24 ` [PATCH V7 3/9] New APIs to adjust per-memcg wmarks Ying Han
2011-04-22  4:32   ` KAMEZAWA Hiroyuki
2011-04-22  4:24 ` [PATCH V7 4/9] Add memcg kswapd thread pool Ying Han
2011-04-22  4:36   ` KAMEZAWA Hiroyuki
2011-04-22  4:49     ` Ying Han
2011-04-22  5:00       ` KAMEZAWA Hiroyuki
2011-04-22  5:53         ` Ying Han
2011-04-22  5:59           ` KAMEZAWA Hiroyuki
2011-04-22  6:10             ` Ying Han
2011-04-22  7:46               ` KAMEZAWA Hiroyuki
2011-04-22  7:59                 ` Ying Han
2011-04-22  8:02                   ` KAMEZAWA Hiroyuki
2011-04-24 23:26                   ` KAMEZAWA Hiroyuki
2011-04-25  2:08                     ` Ying Han
2011-04-22  6:02         ` Zhu Yanhai
2011-04-22  6:14           ` Ying Han
2011-04-22  5:39   ` KOSAKI Motohiro
2011-04-22  5:56     ` KAMEZAWA Hiroyuki
2011-04-22  4:24 ` [PATCH V7 5/9] Infrastructure to support per-memcg reclaim Ying Han
2011-04-22  4:38   ` KAMEZAWA Hiroyuki
2011-04-22  5:11   ` KOSAKI Motohiro
2011-04-22  5:59     ` Ying Han
2011-04-22  5:27   ` KOSAKI Motohiro
2011-04-22  6:00     ` Ying Han
2011-04-22  4:24 ` [PATCH V7 6/9] Implement the select_victim_node within memcg Ying Han
2011-04-22  4:39   ` KAMEZAWA Hiroyuki
2011-04-22  4:24 ` [PATCH V7 7/9] Per-memcg background reclaim Ying Han
2011-04-22  4:40   ` KAMEZAWA Hiroyuki
2011-04-22  6:00   ` KOSAKI Motohiro
2011-04-22  7:54     ` Ying Han
2011-04-22  8:44       ` KOSAKI Motohiro
2011-04-22 18:37         ` Ying Han [this message]
2011-04-25  2:21           ` [PATCH] vmscan,memcg: memcg aware swap token KOSAKI Motohiro
2011-04-25  9:47             ` KAMEZAWA Hiroyuki
2011-04-25 17:13             ` Ying Han
2011-04-26  2:08               ` KOSAKI Motohiro
2011-04-22  4:24 ` [PATCH V7 8/9] Add per-memcg zone "unreclaimable" Ying Han
2011-04-22  4:43   ` KAMEZAWA Hiroyuki
2011-04-22  6:13   ` KOSAKI Motohiro
2011-04-22  6:17     ` Ying Han
2011-04-22  4:24 ` [PATCH V7 9/9] Enable per-memcg background reclaim Ying Han
2011-04-22  4:44   ` KAMEZAWA Hiroyuki

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='BANLkTinB5tGAH=DE55HnE5krGxx1uoXgLA@mail.gmail.com' \
    --to=yinghan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=cl@linux.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mel@csn.ul.ie \
    --cc=mhocko@suse.cz \
    --cc=minchan.kim@gmail.com \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=riel@redhat.com \
    --cc=tj@kernel.org \
    --cc=xemul@openvz.org \
    --cc=zhu.yanhai@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;
as well as URLs for NNTP newsgroup(s).