lockup_detector: Cure hotplug deadlocks and replace duct tape
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest29 patches 19 repliesIn review
- v129 patches 15 repliesSuperseded
Changes in v2 from the cover letter
- Wrapped the perf specific calls into the weak watchdog_nmi_* functions
- Fixed the compile error pointed out by Don
- Fixed the reconfiguration parameter inconsistency which broke powerpc
- Picked up the updated version of patch 11/29
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/29 | hardlockup_detector: Provide interface to stop/restart perf eventsinclude/ kernel/ | +45 | 0 replies | |
| 2/29 | perf/x86/intel: Sanitize PMU HT bug workaroundarch/ | +4 | 0 replies | |
| 3/29 | lockup_detector: Provide interface to stop from poweroff()include/ kernel/ | +16 | 0 replies | |
| 4/29 | parisc: Use lockup_detector_stop()arch/ | +1 | 2 replies | |
| 5/29 | lockup_detector: Remove broken suspend/resume interfacesarch/ include/ kernel/ | +1 | 0 replies | |
| 6/29 | lockup_detector: Rework cpu hotplug lockingkernel/ | +6 | 0 replies | |
| 7/29 | lockup_detector: Rename watchdog_proc_mutexkernel/ | +7 | 0 replies | |
| 8/29 | lockup_detector: Mark hardlockup_detector_disable() __initkernel/ | +1 | 0 replies | |
| 9/29 | lockup_detector/perf: Remove broken self disable on failurekernel/ kernel/ | +7 | 0 replies | |
| 10/29 | lockup_detector/perf: Prevent cpu hotplug deadlockinclude/ kernel/ kernel/ +1 more | +65 | 0 replies | |
| 11/29 | lockup_detector: Remove park_in_progress obfuscationinclude/ kernel/ kernel/ | +19 | 0 replies | |
| 12/29 | lockup_detector: Cleanup stub functionskernel/ | +22 | 0 replies | |
| 13/29 | lockup_detector: Cleanup the ifdef mazekernel/ | +13 | 0 replies | |
| 14/29 | lockup_detector: Split out cpumask write functionkernel/ | +21 | 0 replies | |
| 15/29 | smpboot/threads: Avoid runtime allocationinclude/ kernel/ kernel/ | +14 | 0 replies | |
| 16/29 | lockup_detector: Create new thread handling infrastructurekernel/ | +75 | 0 replies | |
| 17/29 | lockup_detector: Get rid of the thread teardown/setup dancekernel/ | +19 | 0 replies | |
| 18/29 | lockup_detector: Further simplify sysctl handlingkernel/ | +7 | 0 replies | |
| 19/29 | lockup_detector: Cleanup header messinclude/ | +25 | 0 replies | |
| 20/29 | lockup_detector/sysctl: Get rid of the ifdefferyinclude/ kernel/ | +7 | 0 replies | |
| 21/29 | lockup_detector: Cleanup sysctl variable name spaceinclude/ kernel/ kernel/ | +36 | 0 replies | |
| 22/29 | lockup_detector: Make watchdog_nmi_reconfigure() two stagearch/ include/ kernel/ | +33 | 11 replies | |
| 23/29 | lockup_detector: Get rid of the racy update loopkernel/ | +47 | 0 replies | |
| 24/29 | lockup_detector/perf: Implement init time perf validationinclude/ kernel/ | +43 | 0 replies | |
| 25/29 | lockup_detector: Implement init time detection of perfkernel/ | +12 | 3 replies | |
| 26/29 | lockup_detector/perf: Implement CPU enable replacementinclude/ kernel/ | +13 | 0 replies | |
| 27/29 | lockup_detector: Use new perf CPU enable mechanismkernel/ kernel/ | +8 | 0 replies | |
| 28/29 | lockup_detector/perf: Simplify deferred event destroykernel/ | +2 | 0 replies | |
| 29/29 | lockup_detector: Cleanup hotplug locking messarch/ kernel/ | +2 | 0 replies |
Reviews trailers per patch
2 of 29 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Peter Zijlstra | Don Zickus | Helge Deller | Michael Ellerman |
|---|---|---|---|---|
| Series | R-b | |||
| 1/29 | ||||
| 2/29 | ||||
| 3/29 | ||||
| 4/29 | A-b | |||
| 5/29 | ||||
| 6/29 | ||||
| 7/29 | ||||
| 8/29 | ||||
| 9/29 | ||||
| 10/29 | Analyzed-by | |||
| 11/29 | ||||
| 12/29 | ||||
| 13/29 | ||||
| 14/29 | ||||
| 15/29 | ||||
| 16/29 | ||||
| 17/29 | ||||
| 18/29 | ||||
| 19/29 | ||||
| 20/29 | ||||
| 21/29 | ||||
| 22/29 | Tested-and-Reviewed-by | A-b | ||
| 23/29 | ||||
| 24/29 | ||||
| 25/29 | ||||
| 26/29 | ||||
| 27/29 | ||||
| 28/29 | ||||
| 29/29 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [patch V2 00/29] lockup_detector: Cure hotplug deadlocks and replace duct tape
The lockup detector is broken is several ways:
- It's deadlock prone vs. CPU hotplug in various ways. Some of these are due to recursive cpus_read_lock() others are due to cpus_read_lock() from CPU hotplug callbacks which immediately lock the machine because cpus are write locked.
- The handling of the cpu hotplug threads happens sideways to the smpboot thread infrastructure, which is racy and pointless
- The handling of the user space sysctl interface is a complete trainwreck as it fiddles directly with variables which can be modified or evaluated by the running watchdogs.
- The perf event initialization is a trainwreck as it tries to create perf events over and over even if perf is not functional (no hardware, ....). To avoid excessive dmesg spam it contains magic printk ratelimiting along with either wrong or useless messages.
- The code structure is horrible as ifdef sections are scattered all over the place which makes it unreadable
- There is more wreckage, but see the changelogs for the ugly details.
The following series sanitizes the facility and addresses the problems.
Changes since V1:
- Wrapped the perf specific calls into the weak watchdog_nmi_* functions
- Fixed the compile error pointed out by Don
- Fixed the reconfiguration parameter inconsistency which broke powerpc
- Picked up the updated version of patch 11/29
Delta patch below.
Thanks,
tglx
---
Diffstat for the series:
arch/parisc/kernel/process.c | 2 arch/powerpc/kernel/watchdog.c | 22 - arch/x86/events/intel/core.c | 11 include/linux/nmi.h | 121 +++---- include/linux/smpboot.h | 4 kernel/cpu.c | 6 kernel/smpboot.c | 22 - kernel/sysctl.c | 22 - kernel/watchdog.c | 633 ++++++++++++++--------------------------- kernel/watchdog_hld.c | 193 ++++++------ 10 files changed, 434 insertions(+), 602 deletions(-)
Delta patch vs. V1
8<------------------------
arch/powerpc/kernel/watchdog.c +2 -2
@@ -355,12 +355,12 @@ static void watchdog_calc_timeouts(void) wd_timer_period_ms = watchdog_thresh *1000 *2 /5 ; } -void watchdog_nmi_reconfigure (bool stop) +void watchdog_nmi_reconfigure (bool run) {int cpu;cpus_read_lock (); -if (stop) { +if (!run) {for_each_cpu (cpu, &wd_cpus_enabled)stop_wd_on_cpu (cpu); }else {
include/linux/nmi.h +1 -1
@@ -102,7 +102,7 @@ static inline void hardlockup_detector_pstatic inline void hardlockup_detector_perf_enable (void ) { }static inline void hardlockup_detector_perf_cleanup (void ) { }# if !defined(CONFIG_HAVE_NMI_WATCHDOG ) -static int hardlockup_detector_perf_init (void ) {return -ENODEV ; } +static inline int hardlockup_detector_perf_init (void ) {return -ENODEV ; }static inline void arch_touch_nmi_watchdog (void ) {}# else static int hardlockup_detector_perf_init (void ) {return 0 ; }
kernel/watchdog.c +25 -18
89 lines not on this page · raw message