linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* MPOL_BIND on memory only nodes
@ 2016-10-12  9:25 Anshuman Khandual
  2016-10-12  9:43 ` Michal Hocko
  0 siblings, 1 reply; 11+ messages in thread
From: Anshuman Khandual @ 2016-10-12  9:25 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Linux Memory Management List, Andrew Morton, Mel Gorman,
	Michal Hocko, Aneesh Kumar K.V, Balbir Singh, Vlastimil Babka,
	Minchan Kim

Hi,

We have the following function policy_zonelist() which selects a zonelist
during various allocation paths. With this, general user space allocations
(IIUC might not have __GFP_THISNODE) fails while trying to get memory from
a memory only node without CPUs as the application runs some where else
and that node is not part of the nodemask. Why we insist on __GFP_THISNODE ?
On any memory only node its likely that the local node "nd" might not be
part of the nodemask, hence does it make sense to pick up the first node of
the nodemask in those cases without looking for __GFP_THISNODE ?

/* Return a zonelist indicated by gfp for node representing a mempolicy */
static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy,
	int nd)
{
	switch (policy->mode) {
	case MPOL_PREFERRED:
		if (!(policy->flags & MPOL_F_LOCAL))
			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)))
			nd = first_node(policy->v.nodes);
		break;
	default:
		BUG();
	}
	return node_zonelist(nd, gfp);
}

- Anshuman

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-10-13 12:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12  9:25 MPOL_BIND on memory only nodes Anshuman Khandual
2016-10-12  9:43 ` Michal Hocko
2016-10-12 10:38   ` Anshuman Khandual
2016-10-12 11:01     ` Michal Hocko
2016-10-12 13:16   ` Michal Hocko
2016-10-13  9:54     ` Anshuman Khandual
2016-10-13 10:07       ` Michal Hocko
2016-10-13 10:58         ` Anshuman Khandual
2016-10-13 12:51           ` Michal Hocko
2016-10-13 10:24     ` Mel Gorman
2016-10-13 12:38       ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).