Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500238

Re: MPOL_BIND on memory only nodes

From Anshuman Khandual <khandual@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: MPOL_BIND on memory only nodes
Date 2016-10-13 14:30 +0200
Message-ID <srNj3-3tk-7@gated-at.bofh.it> (permalink)
References <sro1j-2kL-9@gated-at.bofh.it> <srokF-2sg-13@gated-at.bofh.it> <srrBU-4SP-39@gated-at.bofh.it> <srLhf-2aW-3@gated-at.bofh.it> <srLhf-2aW-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/13/2016 03:37 PM, Michal Hocko wrote:
> On Thu 13-10-16 15:24:54, Anshuman Khandual wrote:
> [...]
>> Which makes the function look like this. Even with these changes, MPOL_BIND is
>> still going to pick up the local node's zonelist instead of the first node in
>> policy->v.nodes nodemask. It completely ignores policy->v.nodes which it should
>> not.
> 
> Not really. I have tried to explain earlier. We do not ignore policy
> nodemask. This one comes from policy_nodemask. We start with the local
> node but fallback to some of the nodes from the nodemask defined by the
> policy.
> 

Yeah saw your response but did not get that exactly. We dont ignore
policy nodemask while memory allocation, correct. But my point was
we are ignoring policy nodemask while selecting zonelist which will
be used during page allocation. Though the zone contents of both the
zonelists are likely to be same, would not it be better to get the
zone list from the nodemask as well ? Or I am still missing something
here. The following change is what I am trying to propose.

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index ad1c96a..f60ab80 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1685,14 +1685,7 @@ static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy,
                        nd = policy->v.preferred_node;
                break;
        case MPOL_BIND:
-               /*
-                * Normally, MPOL_BIND allocations are node-local within the
-                * allowed nodemask.  However, if __GFP_THISNODE is set and the
-                * current node isn't part of the mask, we use the zonelist for
-                * the first node in the mask instead.
-                */
-               if (unlikely(gfp & __GFP_THISNODE) &&
-                               unlikely(!node_isset(nd, policy->v.nodes)))
+               if (unlikely(!node_isset(nd, policy->v.nodes)))
                        nd = first_node(policy->v.nodes);
                break;
        default:

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

MPOL_BIND on memory only nodes Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2016-10-12 11:30 +0200
  Re: MPOL_BIND on memory only nodes Michal Hocko <mhocko@kernel.org> - 2016-10-12 11:50 +0200
    Re: MPOL_BIND on memory only nodes Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2016-10-12 12:40 +0200
      Re: MPOL_BIND on memory only nodes Michal Hocko <mhocko@kernel.org> - 2016-10-12 13:10 +0200
    Re: MPOL_BIND on memory only nodes Michal Hocko <mhocko@kernel.org> - 2016-10-12 15:20 +0200
      Re: MPOL_BIND on memory only nodes Michal Hocko <mhocko@kernel.org> - 2016-10-13 12:20 +0200
        Re: MPOL_BIND on memory only nodes Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2016-10-13 14:30 +0200
          Re: MPOL_BIND on memory only nodes Michal Hocko <mhocko@kernel.org> - 2016-10-13 15:00 +0200
      Re: MPOL_BIND on memory only nodes Mel Gorman <mgorman@suse.de> - 2016-10-13 12:50 +0200
        Re: MPOL_BIND on memory only nodes Michal Hocko <mhocko@kernel.org> - 2016-10-13 14:40 +0200
      Re: MPOL_BIND on memory only nodes Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2016-10-13 14:50 +0200

csiph-web