From: Xishi Qiu <qiuxishi@huawei.com>
To: Rik van Riel <riel@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>, Xiexiuqi <xiexiuqi@huawei.com>
Subject: Re: is this a problem of numactl in RedHat7.0 ?
Date: Mon, 24 Aug 2015 11:28:25 +0800 [thread overview]
Message-ID: <55DA8F59.1050700@huawei.com> (raw)
In-Reply-To: <55D78FB0.9040906@redhat.com>
On 2015/8/22 4:53, Rik van Riel wrote:
> On 08/21/2015 05:27 AM, Xishi Qiu wrote:
>> I use numactl(--localalloc) tool run a test case, but it shows that
>> the numa policy is prefer, I don't know why.
>
> The kernel implements MPOL_PREFERRED and MPOL_LOCAL
> in the same way. Look at this code in mpol_new(),
> in mm/mempolicy.c:
>
> /*
> * MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
> * MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
> * All other modes require a valid pointer to a non-empty nodemask.
> */
> if (mode == MPOL_PREFERRED) {
> if (nodes_empty(*nodes)) {
> if (((flags & MPOL_F_STATIC_NODES) ||
> (flags & MPOL_F_RELATIVE_NODES)))
> return ERR_PTR(-EINVAL);
> }
> } else if (mode == MPOL_LOCAL) {
> if (!nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> mode = MPOL_PREFERRED;
> } else if (nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
>
Hi Rik,
Thank you for your reply. I find the reason is this patch,
and it is not backport to RedHat 7.0
8790c71a18e5d2d93532ae250bcf5eddbba729cd
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 873de7e..ae3c8f3 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2930,7 +2930,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
unsigned short mode = MPOL_DEFAULT;
unsigned short flags = 0;
- if (pol && pol != &default_policy) {
+ if (pol && pol != &default_policy && !(pol->flags & MPOL_F_MORON)) {
mode = pol->mode;
flags = pol->flags;
}
Thanks,
Xishi Qiu
>
>
>
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Xishi Qiu <qiuxishi@huawei.com>
To: Rik van Riel <riel@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>, Xiexiuqi <xiexiuqi@huawei.com>
Subject: Re: is this a problem of numactl in RedHat7.0 ?
Date: Mon, 24 Aug 2015 11:28:25 +0800 [thread overview]
Message-ID: <55DA8F59.1050700@huawei.com> (raw)
In-Reply-To: <55D78FB0.9040906@redhat.com>
On 2015/8/22 4:53, Rik van Riel wrote:
> On 08/21/2015 05:27 AM, Xishi Qiu wrote:
>> I use numactl(--localalloc) tool run a test case, but it shows that
>> the numa policy is prefer, I don't know why.
>
> The kernel implements MPOL_PREFERRED and MPOL_LOCAL
> in the same way. Look at this code in mpol_new(),
> in mm/mempolicy.c:
>
> /*
> * MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
> * MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
> * All other modes require a valid pointer to a non-empty nodemask.
> */
> if (mode == MPOL_PREFERRED) {
> if (nodes_empty(*nodes)) {
> if (((flags & MPOL_F_STATIC_NODES) ||
> (flags & MPOL_F_RELATIVE_NODES)))
> return ERR_PTR(-EINVAL);
> }
> } else if (mode == MPOL_LOCAL) {
> if (!nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> mode = MPOL_PREFERRED;
> } else if (nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
>
Hi Rik,
Thank you for your reply. I find the reason is this patch,
and it is not backport to RedHat 7.0
8790c71a18e5d2d93532ae250bcf5eddbba729cd
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 873de7e..ae3c8f3 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2930,7 +2930,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
unsigned short mode = MPOL_DEFAULT;
unsigned short flags = 0;
- if (pol && pol != &default_policy) {
+ if (pol && pol != &default_policy && !(pol->flags & MPOL_F_MORON)) {
mode = pol->mode;
flags = pol->flags;
}
Thanks,
Xishi Qiu
>
>
>
next prev parent reply other threads:[~2015-08-24 3:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 9:27 is this a problem of numactl in RedHat7.0 ? Xishi Qiu
2015-08-21 9:27 ` Xishi Qiu
2015-08-21 20:53 ` Rik van Riel
2015-08-21 20:53 ` Rik van Riel
2015-08-24 3:28 ` Xishi Qiu [this message]
2015-08-24 3:28 ` Xishi Qiu
2015-08-24 4:15 ` Xishi Qiu
2015-08-24 4:15 ` Xishi Qiu
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=55DA8F59.1050700@huawei.com \
--to=qiuxishi@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.com \
--cc=xiexiuqi@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.