From 369ba4b5fa30125bcc7a68bf7439475d5e8f8613 Mon Sep 17 00:00:00 2001 From: Li Zefan Date: Thu, 2 Apr 2009 16:57:49 -0700 Subject: [PATCH] --- yaml --- r: 139671 b: refs/heads/master c: 0b4217b3fdddc4a58939720d3ed809537577d48b h: refs/heads/master i: 139669: dfe6776bfa331683bbd76b86b57d5545dd6ae0b7 139667: bbdde1fc716f8fa474d9c463ca2e27c2d5dce876 139663: 10a3cebea39bf5deb6e0092b2502aa85101d51e7 v: v3 --- [refs] | 2 +- trunk/kernel/cpuset.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 051d1872ac34..2dac6a765eac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 83aae4c737866da3280f51fd15da58eddd788397 +refs/heads/master: 0b4217b3fdddc4a58939720d3ed809537577d48b diff --git a/trunk/kernel/cpuset.c b/trunk/kernel/cpuset.c index ee5ec386aa8b..31737957cb62 100644 --- a/trunk/kernel/cpuset.c +++ b/trunk/kernel/cpuset.c @@ -2070,7 +2070,9 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb, } cgroup_lock(); + mutex_lock(&callback_mutex); cpumask_copy(top_cpuset.cpus_allowed, cpu_online_mask); + mutex_unlock(&callback_mutex); scan_for_empty_cpusets(&top_cpuset); ndoms = generate_sched_domains(&doms, &attr); cgroup_unlock(); @@ -2093,11 +2095,12 @@ static int cpuset_track_online_nodes(struct notifier_block *self, cgroup_lock(); switch (action) { case MEM_ONLINE: - top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; - break; case MEM_OFFLINE: + mutex_lock(&callback_mutex); top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; - scan_for_empty_cpusets(&top_cpuset); + mutex_unlock(&callback_mutex); + if (action == MEM_OFFLINE) + scan_for_empty_cpusets(&top_cpuset); break; default: break;