From: Michal Hocko <mhocko@suse.cz>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Ying Han <yinghan@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Tejun Heo <htejun@gmail.com>,
Glauber Costa <glommer@parallels.com>,
linux-mm@kvack.org, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] mmotm: memcgvmscan-do-not-break-out-targeted-reclaim-without-reclaimed-pages.patch fix
Date: Wed, 30 Jan 2013 17:37:50 +0100 [thread overview]
Message-ID: <20130130163750.GB21253@dhcp22.suse.cz> (raw)
In-Reply-To: <20130130162257.GB21614@cmpxchg.org>
On Wed 30-01-13 11:22:57, Johannes Weiner wrote:
> On Tue, Jan 29, 2013 at 09:51:04AM +0100, Michal Hocko wrote:
> > Ying has noticed me (via private email) that the patch is bogus because
> > the break out condition is incorrect. She said she would post a fix
> > but she's been probably too busy. If she doesn't oppose, could you add
> > the follow up fix, please?
> >
> > I am really sorry about this mess.
> > ---
> > >From 6d23b59e96b8173fae2d0d397cb5e99f16899874 Mon Sep 17 00:00:00 2001
> > From: Ying Han <yinghan@google.com>
> > Date: Tue, 29 Jan 2013 09:42:28 +0100
> > Subject: [PATCH] mmotm:
> > memcgvmscan-do-not-break-out-targeted-reclaim-without-reclaimed-pages.patch
> > fix
> >
> > We should break out of the hierarchy loop only if nr_reclaimed exceeded
> > nr_to_reclaim and not vice-versa. This patch fixes the condition.
> >
> > Signed-off-by: Ying Han <yinghan@google.com>
> > ---
> > mm/vmscan.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index d75c1ec..7528eae 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -1985,7 +1985,7 @@ static void shrink_zone(struct zone *zone, struct scan_control *sc)
> > * whole hierarchy is not sufficient.
> > */
> > if (!global_reclaim(sc) &&
> > - sc->nr_to_reclaim >= sc->nr_reclaimed) {
> > + sc->nr_to_reclaim <= sc->nr_reclaimed) {
>
> This is just a really weird ordering of the operands, isn't it? You
> compare the constant to the variable, like if (42 == foo->nr_pages).
>
> if (sc->nr_reclaimed >= sc->nr_to_reclaim)
>
> would be less surprising.
No objections from me.
--
Michal Hocko
SUSE Labs
--
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>
prev parent reply other threads:[~2013-01-30 16:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-03 18:09 [PATCH -repost] memcg,vmscan: do not break out targeted reclaim without reclaimed pages Michal Hocko
2013-01-03 20:24 ` Andrew Morton
2013-01-04 14:52 ` Michal Hocko
2013-01-29 8:51 ` [PATCH] mmotm: memcgvmscan-do-not-break-out-targeted-reclaim-without-reclaimed-pages.patch fix Michal Hocko
2013-01-30 16:22 ` Johannes Weiner
2013-01-30 16:37 ` 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=20130130163750.GB21253@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=glommer@parallels.com \
--cc=hannes@cmpxchg.org \
--cc=htejun@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--cc=yinghan@google.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