From: Kulikov Vasiliy <segooon@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
kernel-janitors@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Lee Schermerhorn <lee.schermerhorn@hp.com>,
Christoph Lameter <cl@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 13/14] mm: mempolicy: Check return code of check_range
Date: Mon, 6 Sep 2010 18:18:13 +0400 [thread overview]
Message-ID: <20100906141813.GB9632@albatros> (raw)
In-Reply-To: <alpine.DEB.2.00.1009060201000.10552@chino.kir.corp.google.com>
On Mon, Sep 06, 2010 at 02:02 -0700, David Rientjes wrote:
> On Mon, 6 Sep 2010, KOSAKI Motohiro wrote:
>
> > > From: Vasiliy Kulikov <segooon@gmail.com>
> > >
> > > Function check_range may return ERR_PTR(...). Check for it.
> >
> > When happen this issue?
> >
> > afaik, check_range return error when following condition.
> > 1) mm->mmap->vm_start argument is incorrect
> > 2) don't have neigher MPOL_MF_STATS, MPOL_MF_MOVE and MPOL_MF_MOVE_ALL
> >
> > I think both case is not happen in real. Am I overlooking anything?
> >
>
> There's no reason not to check the return value of a function when the
> implementation of either could change at any time. migrate_to_node() is
> certainly not in any fastpath where we can't sacrifice a branch for more
> robust code.
Agreed, if you know that the caller must check input data and must not
check return code, it's better to make this function return void.
--
Vasiliy
--
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-09-06 14:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-05 18:33 [PATCH 13/14] mm: mempolicy: Check return code of check_range Kulikov Vasiliy
2010-09-05 22:04 ` David Rientjes
2010-09-05 23:15 ` Christoph Lameter
2010-09-06 0:41 ` KOSAKI Motohiro
2010-09-06 9:02 ` David Rientjes
2010-09-06 14:18 ` Kulikov Vasiliy [this message]
2010-09-07 0:02 ` KOSAKI Motohiro
2010-09-07 1:59 ` Christoph Lameter
2010-09-07 2:04 ` KOSAKI Motohiro
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=20100906141813.GB9632@albatros \
--to=segooon@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=lee.schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@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;
as well as URLs for NNTP newsgroup(s).