diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 2713db8395f6..4f52d03d61ea 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -55,6 +55,7 @@ extern int cpuset_init(void); extern void cpuset_init_smp(void); extern void cpuset_force_rebuild(void); extern void cpuset_update_active_cpus(void); +extern void cpuset_update_active_cpus_affine(int cpu); extern void cpuset_wait_for_hotplug(void); extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); extern void cpuset_cpus_allowed_fallback(struct task_struct *p); diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index c7f574a68cdb..a49b1598466d 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -3289,6 +3289,11 @@ void cpuset_update_active_cpus(void) schedule_work(&cpuset_hotplug_work); } +void cpuset_update_active_cpus_affine(int cpu) +{ + schedule_work_on(cpu, &cpuset_hotplug_work); +} + void cpuset_wait_for_hotplug(void) { flush_work(&cpuset_hotplug_work); diff --git a/kernel/cpu.c b/kernel/cpu.c index b69e0904a1fc..41c73436e745 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1361,11 +1361,11 @@ int resume_cpus(struct cpumask *cpus) prev_prio = pause_reduce_prio(); - /* Lazy Resume. Build domains immediately instead of scheduling - * a workqueue. This is so that the cpu can pull load when - * sent a load balancing kick. + /* Lazy Resume. Build domains through schedule a workqueue on + * resuming cpu. This is so that the resuming cpu can work more + * early, and cannot add additional load to other busy cpu. */ - cpuset_hotplug_workfn(NULL); + cpuset_update_active_cpus_affine(cpumask_first(cpus)); cpus_write_lock();