sched,nohz: fallback to housekeeping cpus before fallback to possible cpus
PATCH 1/1 sched,nohz: fallback to housekeeping cpus before fallback to possible cpus
Let the processes which lose they original cpus run on housekeeping cpus if they can to reduce disturbances on nohz_full cpus.
Cc Thomas Gleixner <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Lai Jiangshan <[email protected]>
--- kernel/sched/core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
kernel/sched/core.c +8 -1
@@ -1286,7 +1286,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p) {int nid =cpu_to_node (cpu);const struct cpumask *nodemask =NULL ; -enum { cpuset, possible, fail } state = cpuset; +enum { cpuset, housekeeping, possible, fail } state = cpuset;int dest_cpu;/*
@@ -1322,8 +1322,15 @@ static int select_fallback_rq(int cpu, struct task_struct *p)case cpuset:/* No more Mr. Nice Guy. */ cpuset_cpus_allowed_fallback (p); + state = housekeeping; +break ; + +case housekeeping: +#ifdef CONFIG_NO_HZ_FULL +do_set_cpus_allowed (p, housekeeping_mask); state = possible;break ; +# endif /* CONFIG_NO_HZ_FULL. Fallthrough when !CONFIG_NO_HZ_FULL */ case possible:do_set_cpus_allowed (p, cpu_possible_mask);
Signature · 1 line
2.1.0
Peter Zijlstra
maintainerQuoted 2 lines · Lai Jiangshan
Let the processes which lose they original cpus run on housekeeping cpus if they can to reduce disturbances on
nohz_fullcpus.
Its a fail if you get here in the first place, why should we fix that?