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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 21 Jul 2017 15:21:28 +0200
From:   Frederic Weisbecker <fweisbec@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     Frederic Weisbecker <fweisbec@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Chris Metcalf <cmetcalf@...lanox.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Luiz Capitulino <lcapitulino@...hat.com>,
        Christoph Lameter <cl@...ux.com>,
        "Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
        Ingo Molnar <mingo@...nel.org>, Mike Galbraith <efault@....de>,
        Rik van Riel <riel@...hat.com>,
        Wanpeng Li <kernellwp@...il.com>
Subject: [RFC PATCH 7/9] housekeeping: Use own boot option, independant from nohz

The housekeeping is currently driven by nohz_full where any CPU that
is not in the nohz_full range is considered as a housekeeper. This is
a design mistake because nohz is just a detail among all the existing
isolation features. Nohz shouldn't imply anything else than tick related
things.

We rather want to drive all the isolation features from the housekeeping
subsystem which is responsible for all the work that can be either
affined (unpinned workqueues, timers, kthreads, ...) or offloaded
(scheduler tick, ...).

Let's start with a boot option to define the housekeepers. We should be
able to further enhance that through cpusets.

Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Chris Metcalf <cmetcalf@...lanox.com>
Cc: Rik van Riel <riel@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Mike Galbraith <efault@....de>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Christoph Lameter <cl@...ux.com>
Cc: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Wanpeng Li <kernellwp@...il.com>
Cc: Luiz Capitulino <lcapitulino@...hat.com>
---
 include/linux/housekeeping.h |  2 --
 init/main.c                  |  2 --
 kernel/housekeeping.c        | 22 ++++++++++------------
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/include/linux/housekeeping.h b/include/linux/housekeeping.h
index 320cc2b..ba769c8 100644
--- a/include/linux/housekeeping.h
+++ b/include/linux/housekeeping.h
@@ -11,7 +11,6 @@ extern int housekeeping_any_cpu(void);
 extern const struct cpumask *housekeeping_cpumask(void);
 extern void housekeeping_affine(struct task_struct *t);
 extern bool housekeeping_test_cpu(int cpu);
-extern void __init housekeeping_init(void);
 
 #else
 
@@ -26,7 +25,6 @@ static inline const struct cpumask *housekeeping_cpumask(void)
 }
 
 static inline void housekeeping_affine(struct task_struct *t) { }
-static inline void housekeeping_init(void) { }
 #endif /* CONFIG_NO_HZ_FULL */
 
 static inline bool housekeeping_cpu(int cpu)
diff --git a/init/main.c b/init/main.c
index 9904a1e..9789ab7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -46,7 +46,6 @@
 #include <linux/cgroup.h>
 #include <linux/efi.h>
 #include <linux/tick.h>
-#include <linux/housekeeping.h>
 #include <linux/interrupt.h>
 #include <linux/taskstats_kern.h>
 #include <linux/delayacct.h>
@@ -608,7 +607,6 @@ asmlinkage __visible void __init start_kernel(void)
 	early_irq_init();
 	init_IRQ();
 	tick_init();
-	housekeeping_init();
 	rcu_init_nohz();
 	init_timers();
 	hrtimers_init();
diff --git a/kernel/housekeeping.c b/kernel/housekeeping.c
index f8be7e6..a54765d 100644
--- a/kernel/housekeeping.c
+++ b/kernel/housekeeping.c
@@ -45,23 +45,21 @@ bool housekeeping_test_cpu(int cpu)
 	return true;
 }
 
-void __init housekeeping_init(void)
+/* Parse the boot-time housekeeping CPU list from the kernel parameters. */
+static int __init housekeeping_setup(char *str)
 {
-	if (!tick_nohz_full_enabled())
-		return;
-
-	if (!alloc_cpumask_var(&housekeeping_mask, GFP_KERNEL)) {
-		WARN(1, "NO_HZ: Can't allocate not-full dynticks cpumask\n");
-		cpumask_clear(tick_nohz_full_mask);
-		tick_nohz_full_running = false;
-		return;
+	alloc_bootmem_cpumask_var(&housekeeping_mask);
+	if (cpulist_parse(str, housekeeping_mask) < 0) {
+		pr_warn("Housekeeping: Incorrect cpumask\n");
+		free_bootmem_cpumask_var(housekeeping_mask);
+		return 1;
 	}
 
-	cpumask_andnot(housekeeping_mask,
-		       cpu_possible_mask, tick_nohz_full_mask);
-
 	static_branch_enable(&housekeeping_overriden);
 
 	/* We need at least one CPU to handle housekeeping work */
 	WARN_ON_ONCE(cpumask_empty(housekeeping_mask));
+
+	return 1;
 }
+__setup("housekeeping=", housekeeping_setup);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ