lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 Apr 2015 17:06:12 +0800
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Lai Jiangshan <laijs@...fujitsu.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Christoph Lameter <cl@...ux.com>,
	Kevin Hilman <khilman@...aro.org>,
	Mike Galbraith <bitbucket@...ine.de>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>
Subject: [PATCH] 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 <tglx@...utronix.de>
Cc: Christoph Lameter <cl@...ux.com>
Cc: Kevin Hilman <khilman@...aro.org>
Cc: Mike Galbraith <bitbucket@...ine.de>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Lai Jiangshan <laijs@...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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ