Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1595171
| From | Anshuman Khandual <khandual@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] mm: Change mbind(MPOL_BIND) implementation for CDM nodes |
| Date | 2017-03-08 14:30 +0100 |
| Message-ID | <tiJPc-77d-33@gated-at.bofh.it> (permalink) |
| References | <tiHX4-5QO-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
CDM nodes need a way of explicit memory allocation mechanism from the user
space. After the previous FALLBACK zonelist rebuilding process changes, the
mbind(MPOL_BIND) based allocation request fails on the CDM node. This is
because allocation requesting local node's FALLBACK zonelist is selected
for further nodemask processing targeted at MPOL_BIND implementation. As
the CDM node's zones are not part of any other regular node's FALLBACK
zonelist, the allocation simply fails without getting any valid zone. The
allocation requesting node is always going to be different than the CDM
node which does not have any CPU. Hence MPOL_MBIND implementation must
choose given CDM node's FALLBACK zonelist instead of the requesting local
node's FALLBACK zonelist. This implements that change.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
mm/mempolicy.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 1e7873e..6089c711 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1692,6 +1692,27 @@ static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy,
WARN_ON_ONCE(policy->mode == MPOL_BIND && (gfp & __GFP_THISNODE));
}
+#ifdef CONFIG_COHERENT_DEVICE
+ /*
+ * Coherent Device Memory (CDM)
+ *
+ * In case the local requesting node is not part of the nodemask, test
+ * if the first node in the nodemask is CDM, in which case select it.
+ *
+ * XXX: There are multiple ways of doing this. This node check can be
+ * restricted to the first node in the node mask as implemented here or
+ * scan through the entire nodemask to find out any present CDM node on
+ * it or select the first CDM node only if all other nodes in the node
+ * mask are CDM. These are variour approaches possible, the first one
+ * is implemented here.
+ */
+ if (policy->mode == MPOL_BIND) {
+ if (unlikely(!node_isset(nd, policy->v.nodes))) {
+ if (is_cdm_node(first_node(policy->v.nodes)))
+ nd = first_node(policy->v.nodes);
+ }
+ }
+#endif
return node_zonelist(nd, gfp);
}
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH V3 0/4] Define coherent device memory node Mel Gorman <mgorman@suse.de> - 2017-03-01 11:40 +0100
Re: [PATCH V3 0/4] Define coherent device memory node Balbir Singh <bsingharora@gmail.com> - 2017-03-01 12:10 +0100
Re: [PATCH V3 0/4] Define coherent device memory node Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-03-08 13:20 +0100
[PATCH 2/2] mm: Change mbind(MPOL_BIND) implementation for CDM nodes Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-03-08 14:30 +0100
csiph-web