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
| ||
|
Date: Wed, 7 May 2014 21:57:41 +0200 From: Borislav Petkov <bp@...en8.de> To: LKML <linux-kernel@...r.kernel.org> Cc: "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra <peterz@...radead.org>, Mel Gorman <mgorman@...e.com>, Steven Rostedt <rostedt@...dmis.org>, Mike Galbraith <mgalbraith@...e.de>, Andrew Morton <akpm@...ux-foundation.org>, Linus Torvalds <torvalds@...ux-foundation.org> Subject: [PATCH] CPU hotplug: Slow down hotplug operations From: Borislav Petkov <bp@...e.de> We have all those eager tester dudes which scratch up a dirty script to pound on CPU hotplug senselessly and then report bugs they've managed to trigger. Well, first of all, most, if not all, bugs they trigger are CPU hotplug related anyway. But we know hotplug is full of duct tape and brown paper bags. So we end up clearly wasting too much time dealing with a mechanism we know it is b0rked in the first place. Oh, and I would understand if that pounding were close to some real usage patterns but I've yet to receive a justification for toggling cores on- and offline senselessly. In any case, before this gets rewritten properly (I'm being told we might get lucky after all) let's slow down hotplugging on purpose and thus make it uninteresting, as a temporary brown paper bag solution until the real thing gets done. This way we'll save us a lot of time and efforts in chasing the wrong bugs. Cc: H. Peter Anvin <hpa@...or.com> Cc: Ingo Molnar <mingo@...nel.org> Cc: Thomas Gleixner <tglx@...utronix.de> Cc: Peter Zijlstra <peterz@...radead.org> Cc: Mel Gorman <mgorman@...e.com> Cc: Steven Rostedt <rostedt@...dmis.org> Cc: Mike Galbraith <mgalbraith@...e.de> Cc: Andrew Morton <akpm@...ux-foundation.org> Cc: Linus Torvalds <torvalds@...ux-foundation.org> Signed-off-by: Borislav Petkov <bp@...e.de> --- drivers/base/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 006b1bc5297d..615c7af767ed 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -40,6 +40,11 @@ static void change_cpu_under_node(struct cpu *cpu, cpu->node_id = to_nid; } +static void delay_hotplug(void) +{ + schedule_timeout_uninterruptible(msecs_to_jiffies(MSEC_PER_SEC)); +} + static int __ref cpu_subsys_online(struct device *dev) { struct cpu *cpu = container_of(dev, struct cpu, dev); @@ -47,6 +52,8 @@ static int __ref cpu_subsys_online(struct device *dev) int from_nid, to_nid; int ret; + delay_hotplug(); + from_nid = cpu_to_node(cpuid); if (from_nid == NUMA_NO_NODE) return -ENODEV; @@ -65,6 +72,8 @@ static int __ref cpu_subsys_online(struct device *dev) static int cpu_subsys_offline(struct device *dev) { + delay_hotplug(); + return cpu_down(dev->id); } -- 1.9.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