From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Phil Carmody <ext-phil.2.carmody@nokia.com>,
balbir@linux.vnet.ibm.com, nishimura@mxp.nes.nec.co.jp,
kirill@shutemov.name, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Paul Menage <menage@google.com>,
"lizf@cn.fujitsu.com" <lizf@cn.fujitsu.com>
Subject: Re: [PATCH 2/2] mm: memcontrol - uninitialised return value
Date: Fri, 7 May 2010 10:07:29 +0900 [thread overview]
Message-ID: <20100507100729.a6589d8a.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20100506142417.6d317068.akpm@linux-foundation.org>
On Thu, 6 May 2010 14:24:17 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
> On Wed, 5 May 2010 14:21:49 +0300
> Phil Carmody <ext-phil.2.carmody@nokia.com> wrote:
>
> > From: Phil Carmody <ext-phil.2.carmody@nokia.com>
> >
> > Only an out of memory error will cause ret to be set.
> >
> > Acked-by: Kirill A. Shutemov <kirill@shutemov.name>
> > Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
> > ---
> > mm/memcontrol.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 90e32b2..09af773 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -3464,7 +3464,7 @@ static int mem_cgroup_unregister_event(struct cgroup *cgrp, struct cftype *cft,
> > int type = MEMFILE_TYPE(cft->private);
> > u64 usage;
> > int size = 0;
> > - int i, j, ret;
> > + int i, j, ret = 0;
> >
> > mutex_lock(&memcg->thresholds_lock);
> > if (type == _MEM)
>
> afacit the return value of cftype.unregister_event() is always ignored
> anyway. Perhaps it should be changed to void-returning, or fixed.
>
>
Ah, it's now "TODO". But hmm...."unregister_event()" is called by workqueue.
(for avoiding race?)
I think unregister_event should be "void" and mem_cgroup_unregister_event()
should be implemented as "never fail" function.
I'll try by myself....but if someone knows this event notifier implementation well,
please.
Thanks,
-Kame
--
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>
next prev parent reply other threads:[~2010-05-07 1:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 11:21 [PATCH 1/2] mm: remove unnecessary use of atomic Phil Carmody
2010-05-05 11:21 ` [PATCH 2/2] mm: memcontrol - uninitialised return value Phil Carmody
2010-05-06 6:18 ` KAMEZAWA Hiroyuki
2010-05-06 21:24 ` Andrew Morton
2010-05-07 1:07 ` KAMEZAWA Hiroyuki [this message]
2010-05-07 5:15 ` Kirill A. Shutemov
2010-05-06 6:18 ` [PATCH 1/2] mm: remove unnecessary use of atomic 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=20100507100729.a6589d8a.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=ext-phil.2.carmody@nokia.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@google.com \
--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