|
@@ -1782,21 +1782,18 @@ static unsigned interleave_nodes(struct mempolicy *policy)
|
|
/*
|
|
/*
|
|
* Depending on the memory policy provide a node from which to allocate the
|
|
* Depending on the memory policy provide a node from which to allocate the
|
|
* next slab entry.
|
|
* next slab entry.
|
|
- * @policy must be protected by freeing by the caller. If @policy is
|
|
|
|
- * the current task's mempolicy, this protection is implicit, as only the
|
|
|
|
- * task can change it's policy. The system default policy requires no
|
|
|
|
- * such protection.
|
|
|
|
*/
|
|
*/
|
|
-unsigned slab_node(void)
|
|
|
|
|
|
+unsigned int mempolicy_slab_node(void)
|
|
{
|
|
{
|
|
struct mempolicy *policy;
|
|
struct mempolicy *policy;
|
|
|
|
+ int node = numa_mem_id();
|
|
|
|
|
|
if (in_interrupt())
|
|
if (in_interrupt())
|
|
- return numa_node_id();
|
|
|
|
|
|
+ return node;
|
|
|
|
|
|
policy = current->mempolicy;
|
|
policy = current->mempolicy;
|
|
if (!policy || policy->flags & MPOL_F_LOCAL)
|
|
if (!policy || policy->flags & MPOL_F_LOCAL)
|
|
- return numa_node_id();
|
|
|
|
|
|
+ return node;
|
|
|
|
|
|
switch (policy->mode) {
|
|
switch (policy->mode) {
|
|
case MPOL_PREFERRED:
|
|
case MPOL_PREFERRED:
|
|
@@ -1816,11 +1813,11 @@ unsigned slab_node(void)
|
|
struct zonelist *zonelist;
|
|
struct zonelist *zonelist;
|
|
struct zone *zone;
|
|
struct zone *zone;
|
|
enum zone_type highest_zoneidx = gfp_zone(GFP_KERNEL);
|
|
enum zone_type highest_zoneidx = gfp_zone(GFP_KERNEL);
|
|
- zonelist = &NODE_DATA(numa_node_id())->node_zonelists[0];
|
|
|
|
|
|
+ zonelist = &NODE_DATA(node)->node_zonelists[0];
|
|
(void)first_zones_zonelist(zonelist, highest_zoneidx,
|
|
(void)first_zones_zonelist(zonelist, highest_zoneidx,
|
|
&policy->v.nodes,
|
|
&policy->v.nodes,
|
|
&zone);
|
|
&zone);
|
|
- return zone ? zone->node : numa_node_id();
|
|
|
|
|
|
+ return zone ? zone->node : node;
|
|
}
|
|
}
|
|
|
|
|
|
default:
|
|
default:
|