From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757651AbdDRTsA (ORCPT ); Tue, 18 Apr 2017 15:48:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53028 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757619AbdDRTr5 (ORCPT ); Tue, 18 Apr 2017 15:47:57 -0400 Message-Id: <20170418170442.665445272@linutronix.de> User-Agent: quilt/0.63-1 Date: Tue, 18 Apr 2017 19:04:42 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Sebastian Siewior Subject: [patch V2 00/24] cpu/hotplug: Convert get_online_cpus() to a percpu_rwsem Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_online_cpus() is used in hot pathes in mainline and even more so in RT. That can show up badly under certain conditions because every locker contends on a global mutex. RT has it's own homebrewn mitigation which is an (badly done) open coded implementation of percpu_rwsems with recursion support. The proper replacement for that are percpu_rwsems, but that requires to remove recursion support. The conversion unearthed real locking issues which were previously not visible because the get_online_cpus() lockdep annotation was implemented with recursion support which prevents lockdep from tracking full dependency chains. These potential deadlocks are not related to recursive calls, they trigger on the first invocation because lockdep now has the full dependency chains available. The following patch series addresses this by - Cleaning up places which call get_online_cpus() nested - Replacing a few instances with cpu_hotplug_disable() to prevent circular locking dependencies. The series depends on git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core plus Linus tree merged in to avoid conflicts It's available in git from git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.hotplug Changes since V1: - Fixed fallout reported by kbuild bot - Repaired the recursive call in perf - Repaired the interaction with jumplabels (Peter Zijlstra) - Renamed _locked to _cpuslocked - Picked up Acked-bys Thanks, tglx ------- arch/arm/kernel/hw_breakpoint.c | 5 arch/mips/kernel/jump_label.c | 2 arch/powerpc/kvm/book3s_hv.c | 8 - arch/powerpc/platforms/powernv/subcore.c | 3 arch/s390/kernel/time.c | 2 arch/x86/events/core.c | 1 arch/x86/events/intel/cqm.c | 12 - arch/x86/kernel/cpu/mtrr/main.c | 2 b/arch/sparc/kernel/jump_label.c | 2 b/arch/tile/kernel/jump_label.c | 2 b/arch/x86/events/intel/core.c | 4 b/arch/x86/kernel/jump_label.c | 2 b/kernel/jump_label.c | 31 ++++- drivers/acpi/processor_driver.c | 4 drivers/cpufreq/cpufreq.c | 9 - drivers/hwtracing/coresight/coresight-etm3x.c | 12 - drivers/hwtracing/coresight/coresight-etm4x.c | 12 - drivers/pci/pci-driver.c | 47 ++++--- include/linux/cpu.h | 2 include/linux/cpuhotplug.h | 29 ++++ include/linux/jump_label.h | 3 include/linux/padata.h | 3 include/linux/pci.h | 1 include/linux/stop_machine.h | 26 +++- kernel/cpu.c | 157 ++++++++------------------ kernel/events/core.c | 9 - kernel/padata.c | 39 +++--- kernel/stop_machine.c | 7 - 28 files changed, 228 insertions(+), 208 deletions(-)