Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319565
b: refs/heads/master
c: e7b691b
h: refs/heads/master
i:
  319563: 31ee43d
v: v3
  • Loading branch information
Andi Kleen authored and Pekka Enberg committed Jun 20, 2012
1 parent 21cf7de commit 2a1579d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c138bc00925521c4e764269db3a903bd2a51592
refs/heads/master: e7b691b085fda913830e5280ae6f724b2a63c824
2 changes: 1 addition & 1 deletion trunk/include/linux/mempolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
extern bool init_nodemask_of_mempolicy(nodemask_t *mask);
extern bool mempolicy_nodemask_intersects(struct task_struct *tsk,
const nodemask_t *mask);
extern unsigned slab_node(struct mempolicy *policy);
extern unsigned slab_node(void);

extern enum zone_type policy_zone;

Expand Down
8 changes: 7 additions & 1 deletion trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,8 +1602,14 @@ static unsigned interleave_nodes(struct mempolicy *policy)
* task can change it's policy. The system default policy requires no
* such protection.
*/
unsigned slab_node(struct mempolicy *policy)
unsigned slab_node(void)
{
struct mempolicy *policy;

if (in_interrupt())
return numa_node_id();

policy = current->mempolicy;
if (!policy || policy->flags & MPOL_F_LOCAL)
return numa_node_id();

Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -3310,7 +3310,7 @@ static void *alternate_node_alloc(struct kmem_cache *cachep, gfp_t flags)
if (cpuset_do_slab_mem_spread() && (cachep->flags & SLAB_MEM_SPREAD))
nid_alloc = cpuset_slab_spread_node();
else if (current->mempolicy)
nid_alloc = slab_node(current->mempolicy);
nid_alloc = slab_node();
if (nid_alloc != nid_here)
return ____cache_alloc_node(cachep, flags, nid_alloc);
return NULL;
Expand Down Expand Up @@ -3342,7 +3342,7 @@ static void *fallback_alloc(struct kmem_cache *cache, gfp_t flags)

retry_cpuset:
cpuset_mems_cookie = get_mems_allowed();
zonelist = node_zonelist(slab_node(current->mempolicy), flags);
zonelist = node_zonelist(slab_node(), flags);

retry:
/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ static void *get_any_partial(struct kmem_cache *s, gfp_t flags,

do {
cpuset_mems_cookie = get_mems_allowed();
zonelist = node_zonelist(slab_node(current->mempolicy), flags);
zonelist = node_zonelist(slab_node(), flags);
for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
struct kmem_cache_node *n;

Expand Down

0 comments on commit 2a1579d

Please sign in to comment.