lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 21 Oct 2016 17:55:20 +0530
From:   "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To:     Vlastimil Babka <vbabka@...e.cz>, Michal Hocko <mhocko@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Mel Gorman <mgorman@...e.de>, David Rientjes <rientjes@...gle.com>,
        Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
        linux-mm@...ck.org, LKML <linux-kernel@...r.kernel.org>,
        Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] mm, mempolicy: clean up __GFP_THISNODE confusion in policy_zonelist

Vlastimil Babka <vbabka@...e.cz> writes:

> On 10/21/2016 01:34 PM, Aneesh Kumar K.V wrote:
>> Michal Hocko <mhocko@...nel.org> writes:
>>>
>>
>> For both MPOL_PREFERED and MPOL_INTERLEAVE we pick the zone list from
>> the node other than the current running node. Why don't we do that for
>> MPOL_BIND ?ie, if the current node is not part of the policy node mask
>> why are we not picking the first node from the policy node mask for
>> MPOL_BIND ?
>
> For MPOL_PREFERED and MPOL_INTERLEAVE we got some explicit preference of nodes, 
> so it makes sense that the nodes in the zonelist we pick are ordered by the 
> distance from that node, regardless of current node.
>
> For MPOL_BIND, we don't have preferences but restrictions. If the current cpu is 
> from a node within the restriction, then great. If it's not, finding a node 
> according to distance from current cpu is probably less arbitrary than by 
> distance from the node that happens to have the lowest id in the node mask?

I agree. This is related to the changes we are working in this part of
the kernel. We are looking at adding support for coherent device. By
default we don't want to allocate memory from the coherent device node,
but then we are looking at an user space interface that can be used to
force allocation.

For now, to avoid allocation hitting the coherent device, we build the
zonelist of the nodes such that zones from the coherent device are not
present in any other node's zone list. We looked at use MPOL_BIND as
the user space interface to force allocation from coherent device node.
MPOL_BIND usage breaks with the above detail you mentioned about
MPOL_BIND.

>From what you are suggesting above, I guess the right approach is to add
coherent node's zones to all the node's zone list and make sure the default
node mask used for allocation (N_MEMORY) doesn't have coherent device
node ?

-aneesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ