linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched,nohz: fallback to housekeeping cpus before fallback to possible cpus
@ 2015-04-01  9:06 Lai Jiangshan
  2015-04-01 11:59 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2015-04-01  9:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: Lai Jiangshan, Thomas Gleixner, Christoph Lameter, Kevin Hilman,
	Mike Galbraith, Viresh Kumar, Frederic Weisbecker, Ingo Molnar,
	Peter Zijlstra, Ingo Molnar

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 <tglx@linutronix.de>
Cc: Christoph Lameter <cl@linux.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Mike Galbraith <bitbucket@online.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
 kernel/sched/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f0f831e..f9ef41a 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -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);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sched,nohz: fallback to housekeeping cpus before fallback to possible cpus
  2015-04-01  9:06 [PATCH] sched,nohz: fallback to housekeeping cpus before fallback to possible cpus Lai Jiangshan
@ 2015-04-01 11:59 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2015-04-01 11:59 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: linux-kernel, Thomas Gleixner, Christoph Lameter, Kevin Hilman,
	Mike Galbraith, Viresh Kumar, Frederic Weisbecker, Ingo Molnar,
	Ingo Molnar

On Wed, Apr 01, 2015 at 05:06:12PM +0800, Lai Jiangshan wrote:
> Let the processes which lose they original cpus run on housekeeping cpus
> if they can to reduce disturbances on nohz_full cpus.

Its a fail if you get here in the first place, why should we fix that?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-01 12:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01  9:06 [PATCH] sched,nohz: fallback to housekeeping cpus before fallback to possible cpus Lai Jiangshan
2015-04-01 11:59 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).