Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119186
b: refs/heads/master
c: f481891
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Linus Torvalds committed Nov 20, 2008
1 parent 851d14e commit 1b91327
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 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: ac97b9f9a2d0b83488e0bbcb8517b229d5c9b142
refs/heads/master: f481891fdc49d3d1b8a9674a1825d183069a805f
4 changes: 0 additions & 4 deletions trunk/include/linux/cpuset.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ static inline int cpuset_do_slab_mem_spread(void)
return current->flags & PF_SPREAD_SLAB;
}

extern void cpuset_track_online_nodes(void);

extern int current_cpuset_is_being_rebound(void);

extern void rebuild_sched_domains(void);
Expand Down Expand Up @@ -151,8 +149,6 @@ static inline int cpuset_do_slab_mem_spread(void)
return 0;
}

static inline void cpuset_track_online_nodes(void) {}

static inline int current_cpuset_is_being_rebound(void)
{
return 0;
Expand Down
19 changes: 16 additions & 3 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/list.h>
#include <linux/mempolicy.h>
#include <linux/mm.h>
#include <linux/memory.h>
#include <linux/module.h>
#include <linux/mount.h>
#include <linux/namei.h>
Expand Down Expand Up @@ -2015,12 +2016,23 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb,
* Call this routine anytime after node_states[N_HIGH_MEMORY] changes.
* See also the previous routine cpuset_track_online_cpus().
*/
void cpuset_track_online_nodes(void)
static int cpuset_track_online_nodes(struct notifier_block *self,
unsigned long action, void *arg)
{
cgroup_lock();
top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
scan_for_empty_cpusets(&top_cpuset);
switch (action) {
case MEM_ONLINE:
top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
break;
case MEM_OFFLINE:
top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];
scan_for_empty_cpusets(&top_cpuset);
break;
default:
break;
}
cgroup_unlock();
return NOTIFY_OK;
}
#endif

Expand All @@ -2036,6 +2048,7 @@ void __init cpuset_init_smp(void)
top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY];

hotcpu_notifier(cpuset_track_online_cpus, 0);
hotplug_memory_notifier(cpuset_track_online_nodes, 10);
}

/**
Expand Down
3 changes: 0 additions & 3 deletions trunk/mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/highmem.h>
#include <linux/vmalloc.h>
#include <linux/ioport.h>
#include <linux/cpuset.h>
#include <linux/delay.h>
#include <linux/migrate.h>
#include <linux/page-isolation.h>
Expand Down Expand Up @@ -498,8 +497,6 @@ int add_memory(int nid, u64 start, u64 size)
/* we online node here. we can't roll back from here. */
node_set_online(nid);

cpuset_track_online_nodes();

if (new_pgdat) {
ret = register_one_node(nid);
/*
Expand Down

0 comments on commit 1b91327

Please sign in to comment.