linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 00/20] cpu/hotplug: Convert get_online_cpus() to a percpu_rwsem
@ 2017-04-15 17:01 Thomas Gleixner
  2017-04-15 17:01 ` [patch 01/20] cpu/hotplug: Provide cpuhp_setup/remove_state[_nocalls]_locked() Thomas Gleixner
                   ` (19 more replies)
  0 siblings, 20 replies; 33+ messages in thread
From: Thomas Gleixner @ 2017-04-15 17:01 UTC (permalink / raw)
  To: LKML; +Cc: Peter Zijlstra, Ingo Molnar, Steven Rostedt, Sebastian Siewior

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

Thanks,

	tglx

-------
 arch/arm/kernel/hw_breakpoint.c               |    5 
 arch/powerpc/kvm/book3s_hv.c                  |    8 -
 arch/powerpc/platforms/powernv/subcore.c      |    2 
 arch/s390/kernel/time.c                       |    2 
 arch/x86/events/core.c                        |    1 
 arch/x86/events/intel/core.c                  |    4 
 arch/x86/events/intel/cqm.c                   |   12 +-
 arch/x86/kernel/cpu/mtrr/main.c               |    2 
 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                      |   46 ++++----
 include/linux/cpuhotplug.h                    |   29 +++++
 include/linux/padata.h                        |    3 
 include/linux/pci.h                           |    1 
 include/linux/stop_machine.h                  |   26 ++++
 kernel/cpu.c                                  |  149 +++++++-------------------
 kernel/padata.c                               |   38 +++---
 kernel/stop_machine.c                         |    4 
 20 files changed, 177 insertions(+), 192 deletions(-)

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

end of thread, other threads:[~2017-04-18 19:51 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-15 17:01 [patch 00/20] cpu/hotplug: Convert get_online_cpus() to a percpu_rwsem Thomas Gleixner
2017-04-15 17:01 ` [patch 01/20] cpu/hotplug: Provide cpuhp_setup/remove_state[_nocalls]_locked() Thomas Gleixner
2017-04-15 17:01 ` [patch 02/20] stop_machine: Provide stop_machine_locked() Thomas Gleixner
2017-04-15 17:01 ` [patch 03/20] padata: Make padata_alloc() static Thomas Gleixner
2017-04-16  6:22   ` Jason A. Donenfeld
2017-04-17  9:14     ` Thomas Gleixner
2017-04-15 17:01 ` [patch 04/20] padata: Avoid nested calls to get_online_cpus() in pcrypt_init_padata() Thomas Gleixner
2017-04-15 17:01 ` [patch 05/20] x86/mtrr: Remove get_online_cpus() from mtrr_save_state() Thomas Gleixner
2017-04-15 17:01 ` [patch 06/20] cpufreq: Use cpuhp_setup_state_nocalls_locked() Thomas Gleixner
2017-04-15 22:54   ` Rafael J. Wysocki
2017-04-17  4:14   ` Viresh Kumar
2017-04-15 17:01 ` [patch 07/20] KVM/PPC/Book3S HV: " Thomas Gleixner
2017-04-15 17:01 ` [patch 08/20] hwtracing/coresight-etm3x: Use the locked version of cpuhp_setup_state_nocalls() Thomas Gleixner
2017-04-15 17:01 ` [patch 09/20] hwtracing/coresight-etm4x: Use cpuhp_setup_state_nocalls_locked() Thomas Gleixner
2017-04-15 17:01 ` [patch 10/20] perf/x86/intel/cqm: Use cpuhp_setup_state_locked() Thomas Gleixner
2017-04-15 17:01 ` [patch 11/20] ARM/hw_breakpoint: " Thomas Gleixner
2017-04-15 17:01 ` [patch 12/20] s390/kernel: Use stop_machine_locked() Thomas Gleixner
2017-04-15 17:01 ` [patch 13/20] powerpc/powernv: " Thomas Gleixner
2017-04-15 17:01 ` [patch 14/20] kernel/hotplug: Use stop_machine_locked() in takedown_cpu() Thomas Gleixner
2017-04-15 17:01 ` [patch 15/20] x86/perf: Drop EXPORT of perf_check_microcode Thomas Gleixner
2017-04-18 11:24   ` Borislav Petkov
2017-04-15 17:01 ` [patch 16/20] perf/x86/intel: Drop get_online_cpus() in intel_snb_check_microcode() Thomas Gleixner
2017-04-18 11:27   ` Borislav Petkov
2017-04-15 17:01 ` [patch 17/20] PCI: Use cpu_hotplug_disable() instead of get_online_cpus() Thomas Gleixner
2017-04-17  6:46   ` Peter Zijlstra
2017-04-17  7:40     ` Thomas Gleixner
2017-04-18 19:44   ` Bjorn Helgaas
2017-04-18 19:51     ` Thomas Gleixner
2017-04-15 17:01 ` [patch 18/20] PCI: Replace the racy recursion prevention Thomas Gleixner
2017-04-15 17:01 ` [patch 19/20] ACPI/processor: Use cpu_hotplug_disable() instead of get_online_cpus() Thomas Gleixner
2017-04-16 22:53   ` Rafael J. Wysocki
2017-04-15 17:01 ` [patch 20/20] cpu/hotplug: Convert hotplug locking to percpu rwsem Thomas Gleixner
2017-04-17  6:50   ` 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).