Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20451
b: refs/heads/master
c: dd942ae
h: refs/heads/master
i:
  20449: c02ab70
  20447: d1b5062
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Feb 17, 2006
1 parent 516c94f commit 74026cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 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: 759b650f54ed13e9b3d6c064c763a72ee09c74dd
refs/heads/master: dd942ae331425812930cd01766178b7e28e65f2d
18 changes: 14 additions & 4 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,29 @@ static int mpol_check_policy(int mode, nodemask_t *nodes)
}
return nodes_subset(*nodes, node_online_map) ? 0 : -EINVAL;
}

/* Generate a custom zonelist for the BIND policy. */
static struct zonelist *bind_zonelist(nodemask_t *nodes)
{
struct zonelist *zl;
int num, max, nd;
int num, max, nd, k;

max = 1 + MAX_NR_ZONES * nodes_weight(*nodes);
zl = kmalloc(sizeof(void *) * max, GFP_KERNEL);
zl = kmalloc(sizeof(struct zone *) * max, GFP_KERNEL);
if (!zl)
return NULL;
num = 0;
for_each_node_mask(nd, *nodes)
zl->zones[num++] = &NODE_DATA(nd)->node_zones[policy_zone];
/* First put in the highest zones from all nodes, then all the next
lower zones etc. Avoid empty zones because the memory allocator
doesn't like them. If you implement node hot removal you
have to fix that. */
for (k = policy_zone; k >= 0; k--) {
for_each_node_mask(nd, *nodes) {
struct zone *z = &NODE_DATA(nd)->node_zones[k];
if (z->present_pages > 0)
zl->zones[num++] = z;
}
}
zl->zones[num] = NULL;
return zl;
}
Expand Down

0 comments on commit 74026cf

Please sign in to comment.