[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55DA9A4B.10203@huawei.com>
Date: Mon, 24 Aug 2015 12:15:07 +0800
From: Xishi Qiu <qiuxishi@...wei.com>
To: Rik van Riel <riel@...hat.com>
CC: LKML <linux-kernel@...r.kernel.org>, Linux MM <linux-mm@...ck.org>,
Xiexiuqi <xiexiuqi@...wei.com>
Subject: Re: is this a problem of numactl in RedHat7.0 ?
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:
>
user:
"numactl --localalloc" wil call
main()
numa_set_localalloc()
setpol(MPOL_DEFAULT, numa_no_nodes_ptr);
set_mempolicy()
syscall(__NR_set_mempolicy,mode,nmask,maxnode);
kernel:
do_set_mempolicy()
mpol_new()
if (mode == MPOL_DEFAULT) {
if (nodes && !nodes_empty(*nodes))
return ERR_PTR(-EINVAL);
return NULL; // return from here
}
> /*
> * 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);
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists