Skip to content

watchdog_hld cleanup and async model for arm64

Pingfan Liu linux-arm-kernel lkml oe-kbuild-all 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v24 patches 10 repliesSuperseded
  3. v15 patches 15 repliesSuperseded

Changes in v3 from the cover letter

check the delay work waken up and flush the work before __initdata is free. improve the commit log of [4/4]
rebase to v5.15-rc5

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4kernel/watchdog: trival cleanupsarch/sparc/kernel/nmi.c include/linux/nmi.h kernel/watchdog.c+6 -90 replies
2/4kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup detector eventkernel/watchdog_hld.c+4 -10 replies
3/4kernel/watchdog: Adapt the watchdog_hld interface for async modelinclude/linux/nmi.h kernel/watchdog.c+64 -20 replies
4/4arm64: Enable perf events based hard lockup detectorarch/arm64/Kconfig arch/arm64/kernel/Makefile arch/arm64/kernel/perf_event.c +3 more+55 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCHv3 0/4] watchdog_hld cleanup and async model for arm64

Hard lockup detector is helpful to diagnose unpaired irq enable/disable. But the current watchdog framework can not cope with arm64 hw perf event easily.

On arm64, when lockup_detector_init()->watchdog_nmi_probe(), PMU is not ready until device_initcall(armv8_pmu_driver_init). And it is deeply integrated with the driver model and cpuhp. Hence it is hard to push the initialization of armv8_pmu_driver_init() before smp_init().

But it is easy to take an opposite approach by enabling watchdog_hld to get the capability of PMU async.
The async model is achieved by expanding watchdog_nmi_probe() with -EBUSY, and a re-initializing work_struct which waits on a wait_queue_head.

In this series, [1-2/4] are trivial cleanup. [3-4/4] is for this async model.

v2 -> v3:
check the delay work waken up and flush the work before __initdata is free. improve the commit log of [4/4]
rebase to v5.15-rc5

v1 > v2:
uplift the async model from hard lockup layer to watchdog layter.
The benefit is simpler code, the drawback is re-initialize means wasted alloc/free.

Cc: Sumit Garg <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Sami Tolvanen <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Wang Qing <[email protected]>
Cc: "Peter Zijlstra (Intel)" <[email protected]>
Cc: Santosh Sivaraj <[email protected]>
To: [email protected]
To: [email protected]

*** BLURB HERE ***

Pingfan Liu (3):
kernel/watchdog: trival cleanups
kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup
detector event
kernel/watchdog: Adapt the watchdog_hld interface for async model

Sumit Garg (1):
arm64: Enable perf events based hard lockup detector

 arch/arm64/Kconfig               |  2 ++
 arch/arm64/kernel/Makefile       |  1 +
 arch/arm64/kernel/perf_event.c   | 11 ++++--
 arch/arm64/kernel/watchdog_hld.c | 36 +++++++++++++++++++
 arch/sparc/kernel/nmi.c          |  8 ++---
 drivers/perf/arm_pmu.c           |  5 +++
 include/linux/nmi.h              | 11 +++++-
 include/linux/perf/arm_pmu.h     |  2 ++
 kernel/watchdog.c                | 62 ++++++++++++++++++++++++++++----
 kernel/watchdog_hld.c            |  5 ++-
 10 files changed, 129 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm64/kernel/watchdog_hld.c
Signature · 1 line
2.31.1