From: Michal Hocko <mhocko@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.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: [trivial PATCH v2] Remove pointless next_mz nullification in mem_cgroup_soft_limit_reclaim
Date: Wed, 30 Mar 2011 10:55:45 +0200 [thread overview]
Message-ID: <20110330085544.GD15394@tiehlicka.suse.cz> (raw)
In-Reply-To: <20110330161800.2e7dc268.nishimura@mxp.nes.nec.co.jp>
On Wed 30-03-11 16:18:00, Daisuke Nishimura wrote:
> > From: Michal Hocko <mhocko@suse.cz>
> > Subject: Remove pointless next_mz nullification in mem_cgroup_soft_limit_reclaim
> >
> > next_mz is assigned to NULL if __mem_cgroup_largest_soft_limit_node selects
> > the same mz. This doesn't make much sense as we assign to the variable
> > right in the next loop.
> >
> > Compiler will probably optimize this out but it is little bit confusing for
> > the code reading.
> >
> > Signed-off-by: Michal Hocko <mhocko@suse.cz>
>
> Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Thanks Daisuke.
Andrew, should this go though your mm tree?
---
From: Michal Hocko <mhocko@suse.cz>
Subject: Remove pointless next_mz nullification in mem_cgroup_soft_limit_reclaim
next_mz is assigned to NULL if __mem_cgroup_largest_soft_limit_node selects
the same mz. This doesn't make much sense as we assign to the variable
right in the next loop.
Compiler will probably optimize this out but it is little bit confusing for
the code reading.
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Index: linux-2.6.38-rc8/mm/memcontrol.c
===================================================================
--- linux-2.6.38-rc8.orig/mm/memcontrol.c 2011-03-28 11:25:14.000000000 +0200
+++ linux-2.6.38-rc8/mm/memcontrol.c 2011-03-30 08:57:52.000000000 +0200
@@ -3347,10 +3347,9 @@ unsigned long mem_cgroup_soft_limit_recl
*/
next_mz =
__mem_cgroup_largest_soft_limit_node(mctz);
- if (next_mz == mz) {
+ if (next_mz == mz)
css_put(&next_mz->mem->css);
- next_mz = NULL;
- } else /* next_mz == NULL or other memcg */
+ else /* next_mz == NULL or other memcg */
break;
} while (1);
}
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
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>
prev parent reply other threads:[~2011-03-30 8:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-29 13:28 [trivial PATCH] " Michal Hocko
2011-03-29 13:40 ` Zhu Yanhai
2011-03-29 13:45 ` Michal Hocko
2011-03-29 13:50 ` Zhu Yanhai
2011-03-30 2:09 ` Daisuke Nishimura
2011-03-30 7:02 ` [trivial PATCH v2] " Michal Hocko
2011-03-30 7:18 ` Daisuke Nishimura
2011-03-30 8:55 ` Michal Hocko [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=20110330085544.GD15394@tiehlicka.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
/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