Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1211750
| From | Xishi Qiu <qiuxishi@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: is this a problem of numactl in RedHat7.0 ? |
| Date | 2015-08-24 05:40 +0200 |
| Message-ID | <q0QM1-49d-1@gated-at.bofh.it> (permalink) |
| References | <pZQXO-86r-53@gated-at.bofh.it> <q01zP-6sW-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
is this a problem of numactl in RedHat7.0 ? Xishi Qiu <qiuxishi@huawei.com> - 2015-08-21 11:40 +0200
Re: is this a problem of numactl in RedHat7.0 ? Rik van Riel <riel@redhat.com> - 2015-08-21 23:00 +0200
Re: is this a problem of numactl in RedHat7.0 ? Xishi Qiu <qiuxishi@huawei.com> - 2015-08-24 05:40 +0200
Re: is this a problem of numactl in RedHat7.0 ? Xishi Qiu <qiuxishi@huawei.com> - 2015-08-24 06:30 +0200
csiph-web