ANDROID: cpuhp/pause: schedule cpu_hotplug_work on resume cpu
Resume cpu need to run cpuset_hotplug_workfn which need take
about several milliseconds, and even more if the system have
more tasks.
This isn't suitable to run in the main task context of resume
cpu.
Due to the cpu which is resuming only have active mask,
but still not rebuild sched domain, make this slow
work run on resuming cpu can not take extra overload to
previous active cpus.
Bug: 203839955
Fixes: 1d3a64fbd2
("ANDROID: cpu/hotplug: rebuild sched
domains immediately")
Change-Id: Ia7bdd077f982950c02696c3598a41b2482046220
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user