From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752850AbbHUUxN (ORCPT ); Fri, 21 Aug 2015 16:53:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48345 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221AbbHUUxL (ORCPT ); Fri, 21 Aug 2015 16:53:11 -0400 Message-ID: <55D78FB0.9040906@redhat.com> Date: Fri, 21 Aug 2015 16:53:04 -0400 From: Rik van Riel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Xishi Qiu , LKML , Linux MM CC: Xiexiuqi Subject: Re: is this a problem of numactl in RedHat7.0 ? References: <55D6EEEB.7050701@huawei.com> In-Reply-To: <55D6EEEB.7050701@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);