From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: 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>,
David Rientjes <rientjes@google.com>,
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 09:41:28 +0900 (JST) [thread overview]
Message-ID: <20100906093610.C8B5.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <1283711588-7628-1-git-send-email-segooon@gmail.com>
> 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?
>
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
> ---
> Compile tested.
>
> mm/mempolicy.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index f969da5..b73f02c 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -924,12 +924,15 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
> nodemask_t nmask;
> LIST_HEAD(pagelist);
> int err = 0;
> + struct vm_area_struct *vma;
>
> nodes_clear(nmask);
> node_set(source, nmask);
>
> - check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
> + vma = check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
> flags | MPOL_MF_DISCONTIG_OK, &pagelist);
> + if (IS_ERR(vma))
> + return PTR_ERR(vma);
>
> if (!list_empty(&pagelist))
> err = migrate_pages(&pagelist, new_node_page, dest, 0);
> --
> 1.7.0.4
>
next prev parent reply other threads:[~2010-09-06 0:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-05 18:33 Kulikov Vasiliy
2010-09-05 22:04 ` David Rientjes
2010-09-05 23:15 ` Christoph Lameter
2010-09-06 0:41 ` KOSAKI Motohiro [this message]
2010-09-06 9:02 ` David Rientjes
2010-09-06 14:18 ` Kulikov Vasiliy
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=20100906093610.C8B5.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.schermerhorn@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=segooon@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
all inboxes | Powered by JetHome®