Linux Watchdog driver development
 help / color / mirror / Atom feed
* [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module
@ 2026-07-30 22:00 Mayank Rungta via B4 Relay
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Mayank Rungta via B4 Relay @ 2026-07-30 22:00 UTC (permalink / raw)
  To: Andrew Morton, Wim Van Sebroeck, Guenter Roeck
  Cc: Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog,
	Mayank Rungta

All other watchdog pretimeout governors (noop, panic) can be built as
loadable modules. However the "dump" pretimeout governor is restricted
to built-in code because it calls trigger_all_cpu_backtrace(), which
relies on arch_trigger_cpumask_backtrace(), an arch specific helper that
is not exported to loadable modules.

This 2-patch series allows building the dump governor as a module (=m):
1) Export cpumask_backtrace() in lib/nmi_backtrace.c.
2) Convert CONFIG_WATCHDOG_PRETIMEOUT_GOV_DUMP from bool to tristate.

Signed-off-by: Mayank Rungta <mrungta@google.com>
---
Mayank Rungta (2):
      nmi: Export CPU backtrace APIs for loadable modules
      watchdog: pretimeout: Convert dump pretimeout governor to tristate

 drivers/watchdog/Kconfig |  4 ++--
 include/linux/nmi.h      | 10 ++++++----
 lib/nmi_backtrace.c      |  7 +++++++
 3 files changed, 15 insertions(+), 6 deletions(-)
---
base-commit: 3fe08b9796f36ef437ab9328e7dd1e5ff2d66603
change-id: 20260728-export-cpu-backtrace-apis-136d3b819377

Best regards,
-- 
Mayank Rungta <mrungta@google.com>



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

* [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules
  2026-07-30 22:00 [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Mayank Rungta via B4 Relay
@ 2026-07-30 22:00 ` Mayank Rungta via B4 Relay
  2026-07-31  1:54   ` Doug Anderson
                     ` (3 more replies)
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
  2026-07-30 22:50 ` [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Andrew Morton
  2 siblings, 4 replies; 16+ messages in thread
From: Mayank Rungta via B4 Relay @ 2026-07-30 22:00 UTC (permalink / raw)
  To: Andrew Morton, Wim Van Sebroeck, Guenter Roeck
  Cc: Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog,
	Mayank Rungta

From: Mayank Rungta <mrungta@google.com>

Currently, CPU backtrace functions cannot be called from loadable
modules because the underlying helper arch_trigger_cpumask_backtrace()
is not exported.

Instead of exporting arch_trigger_cpumask_backtrace() individually
across every supported architecture, introduce and export a common
helper, cpumask_backtrace(), in lib/nmi_backtrace.c. Update the four
inline CPU backtrace macros in include/linux/nmi.h to route through this
centralized helper.

Signed-off-by: Mayank Rungta <mrungta@google.com>
---
 include/linux/nmi.h | 10 ++++++----
 lib/nmi_backtrace.c |  7 +++++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/include/linux/nmi.h b/include/linux/nmi.h
index 89c5465e2524..af69712df5f4 100644
--- a/include/linux/nmi.h
+++ b/include/linux/nmi.h
@@ -157,27 +157,29 @@ static inline void touch_nmi_watchdog(void)
  * to allow calling code to fall back to some other mechanism:
  */
 #ifdef arch_trigger_cpumask_backtrace
+void cpumask_backtrace(const cpumask_t *mask, int exclude_cpu);
+
 static inline bool trigger_all_cpu_backtrace(void)
 {
-	arch_trigger_cpumask_backtrace(cpu_online_mask, -1);
+	cpumask_backtrace(cpu_online_mask, -1);
 	return true;
 }
 
 static inline bool trigger_allbutcpu_cpu_backtrace(int exclude_cpu)
 {
-	arch_trigger_cpumask_backtrace(cpu_online_mask, exclude_cpu);
+	cpumask_backtrace(cpu_online_mask, exclude_cpu);
 	return true;
 }
 
 static inline bool trigger_cpumask_backtrace(struct cpumask *mask)
 {
-	arch_trigger_cpumask_backtrace(mask, -1);
+	cpumask_backtrace(mask, -1);
 	return true;
 }
 
 static inline bool trigger_single_cpu_backtrace(int cpu)
 {
-	arch_trigger_cpumask_backtrace(cpumask_of(cpu), -1);
+	cpumask_backtrace(cpumask_of(cpu), -1);
 	return true;
 }
 
diff --git a/lib/nmi_backtrace.c b/lib/nmi_backtrace.c
index a3bfa9360b23..f39c9eca8888 100644
--- a/lib/nmi_backtrace.c
+++ b/lib/nmi_backtrace.c
@@ -19,6 +19,7 @@
 #include <linux/stringify.h>
 #include <linux/nmi.h>
 #include <linux/cpu.h>
+#include <linux/export.h>
 #include <linux/sched/debug.h>
 
 #ifdef arch_trigger_cpumask_backtrace
@@ -129,4 +130,10 @@ bool nmi_cpu_backtrace(struct pt_regs *regs)
 	return false;
 }
 NOKPROBE_SYMBOL(nmi_cpu_backtrace);
+
+void cpumask_backtrace(const cpumask_t *mask, int exclude_cpu)
+{
+	arch_trigger_cpumask_backtrace(mask, exclude_cpu);
+}
+EXPORT_SYMBOL_GPL(cpumask_backtrace);
 #endif

-- 
2.55.0.508.g3f0d502094-goog



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

* [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate
  2026-07-30 22:00 [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Mayank Rungta via B4 Relay
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
@ 2026-07-30 22:00 ` Mayank Rungta via B4 Relay
  2026-07-31  1:55   ` Doug Anderson
                     ` (4 more replies)
  2026-07-30 22:50 ` [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Andrew Morton
  2 siblings, 5 replies; 16+ messages in thread
From: Mayank Rungta via B4 Relay @ 2026-07-30 22:00 UTC (permalink / raw)
  To: Andrew Morton, Wim Van Sebroeck, Guenter Roeck
  Cc: Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog,
	Mayank Rungta

From: Mayank Rungta <mrungta@google.com>

Commit 645ad41da8b2 ("watchdog: pretimeout: Add "dump" pretimeout
governor") added the "dump" watchdog pretimeout governor, but restricted
it to built-in code because trigger_all_cpu_backtrace() was not exported
to loadable modules.

Now that CPU backtrace APIs are supported for loadable kernel modules
via cpumask_backtrace(), convert WATCHDOG_PRETIMEOUT_GOV_DUMP to
tristate. This allows kernels to deliver the pretimeout governor as a
loadable kernel module.

Signed-off-by: Mayank Rungta <mrungta@google.com>
---
 drivers/watchdog/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 9f013d774897..922741dd837c 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -99,8 +99,8 @@ config WATCHDOG_PRETIMEOUT_GOV_SEL
 if WATCHDOG_PRETIMEOUT_GOV
 
 config WATCHDOG_PRETIMEOUT_GOV_DUMP
-	bool "Dump watchdog pretimeout governor"
-	depends on WATCHDOG_CORE=y
+	tristate "Dump watchdog pretimeout governor"
+	depends on WATCHDOG_CORE
 	default WATCHDOG_CORE
 	help
 	  Dump watchdog pretimeout governor, all cpu backtrace is

-- 
2.55.0.508.g3f0d502094-goog



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

* Re: [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module
  2026-07-30 22:00 [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Mayank Rungta via B4 Relay
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
@ 2026-07-30 22:50 ` Andrew Morton
  2026-07-30 23:39   ` Mayank Rungta
  2 siblings, 1 reply; 16+ messages in thread
From: Andrew Morton @ 2026-07-30 22:50 UTC (permalink / raw)
  To: mrungta
  Cc: Mayank Rungta via B4 Relay, Wim Van Sebroeck, Guenter Roeck,
	Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog

On Thu, 30 Jul 2026 15:00:20 -0700 Mayank Rungta via B4 Relay <devnull+mrungta.google.com@kernel.org> wrote:

> All other watchdog pretimeout governors (noop, panic) can be built as
> loadable modules. However the "dump" pretimeout governor is restricted
> to built-in code because it calls trigger_all_cpu_backtrace(), which
> relies on arch_trigger_cpumask_backtrace(), an arch specific helper that
> is not exported to loadable modules.
> 
> This 2-patch series allows building the dump governor as a module (=m):
> 1) Export cpumask_backtrace() in lib/nmi_backtrace.c.
> 2) Convert CONFIG_WATCHDOG_PRETIMEOUT_GOV_DUMP from bool to tristate.

LGTM.  Can you please redo against current mainline?  The Kconfig has
changed.


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

* Re: [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module
  2026-07-30 22:50 ` [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Andrew Morton
@ 2026-07-30 23:39   ` Mayank Rungta
  2026-07-31 21:01     ` Andrew Morton
  0 siblings, 1 reply; 16+ messages in thread
From: Mayank Rungta @ 2026-07-30 23:39 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mayank Rungta via B4 Relay, Wim Van Sebroeck, Guenter Roeck,
	Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog

On Thu, Jul 30, 2026 at 3:50 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Thu, 30 Jul 2026 15:00:20 -0700 Mayank Rungta via B4 Relay <devnull+mrungta.google.com@kernel.org> wrote:
>
> > All other watchdog pretimeout governors (noop, panic) can be built as
> > loadable modules. However the "dump" pretimeout governor is restricted
> > to built-in code because it calls trigger_all_cpu_backtrace(), which
> > relies on arch_trigger_cpumask_backtrace(), an arch specific helper that
> > is not exported to loadable modules.
> >
> > This 2-patch series allows building the dump governor as a module (=m):
> > 1) Export cpumask_backtrace() in lib/nmi_backtrace.c.
> > 2) Convert CONFIG_WATCHDOG_PRETIMEOUT_GOV_DUMP from bool to tristate.
>
> LGTM.  Can you please redo against current mainline?  The Kconfig has
> changed.
>

Thanks for the LGTM!

Regarding rebasing onto mainline (origin/master): The "dump"
pretimeout governor was added recently by Tzung-Bi Shih ("watchdog:
pretimeout: Add "dump" pretimeout governor") and is currently in
linux-next, so it hasn't landed in mainline tree yet.

Because of this dependency, I based this series on linux-next so that
patch 2/2 ("Convert dump pretimeout governor to tristate") could apply
cleanly on top of the new governor.

Please let me know what is preferred, or if you'd like me to post
against a different tree!

Thanks,
Mayank

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

* Re: [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
@ 2026-07-31  1:54   ` Doug Anderson
  2026-08-06 21:40   ` Guenter Roeck
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2026-07-31  1:54 UTC (permalink / raw)
  To: mrungta
  Cc: Andrew Morton, Wim Van Sebroeck, Guenter Roeck, Tzung-Bi Shih,
	linux-kernel, linux-watchdog

Hi,

On Thu, Jul 30, 2026 at 3:00 PM Mayank Rungta via B4 Relay
<devnull+mrungta.google.com@kernel.org> wrote:
>
> From: Mayank Rungta <mrungta@google.com>
>
> Currently, CPU backtrace functions cannot be called from loadable
> modules because the underlying helper arch_trigger_cpumask_backtrace()
> is not exported.
>
> Instead of exporting arch_trigger_cpumask_backtrace() individually
> across every supported architecture, introduce and export a common
> helper, cpumask_backtrace(), in lib/nmi_backtrace.c. Update the four
> inline CPU backtrace macros in include/linux/nmi.h to route through this
> centralized helper.
>
> Signed-off-by: Mayank Rungta <mrungta@google.com>
> ---
>  include/linux/nmi.h | 10 ++++++----
>  lib/nmi_backtrace.c |  7 +++++++
>  2 files changed, 13 insertions(+), 4 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* Re: [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
@ 2026-07-31  1:55   ` Doug Anderson
  2026-08-01 12:38   ` Tzung-Bi Shih
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Doug Anderson @ 2026-07-31  1:55 UTC (permalink / raw)
  To: mrungta
  Cc: Andrew Morton, Wim Van Sebroeck, Guenter Roeck, Tzung-Bi Shih,
	linux-kernel, linux-watchdog

Hi,

On Thu, Jul 30, 2026 at 3:00 PM Mayank Rungta via B4 Relay
<devnull+mrungta.google.com@kernel.org> wrote:
>
> From: Mayank Rungta <mrungta@google.com>
>
> Commit 645ad41da8b2 ("watchdog: pretimeout: Add "dump" pretimeout
> governor") added the "dump" watchdog pretimeout governor, but restricted
> it to built-in code because trigger_all_cpu_backtrace() was not exported
> to loadable modules.
>
> Now that CPU backtrace APIs are supported for loadable kernel modules
> via cpumask_backtrace(), convert WATCHDOG_PRETIMEOUT_GOV_DUMP to
> tristate. This allows kernels to deliver the pretimeout governor as a
> loadable kernel module.
>
> Signed-off-by: Mayank Rungta <mrungta@google.com>
> ---
>  drivers/watchdog/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* Re: [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module
  2026-07-30 23:39   ` Mayank Rungta
@ 2026-07-31 21:01     ` Andrew Morton
  2026-07-31 21:19       ` Guenter Roeck
  0 siblings, 1 reply; 16+ messages in thread
From: Andrew Morton @ 2026-07-31 21:01 UTC (permalink / raw)
  To: Mayank Rungta
  Cc: Mayank Rungta via B4 Relay, Wim Van Sebroeck, Guenter Roeck,
	Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog

On Thu, 30 Jul 2026 16:39:14 -0700 Mayank Rungta <mrungta@google.com> wrote:

> On Thu, Jul 30, 2026 at 3:50 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> >
> > On Thu, 30 Jul 2026 15:00:20 -0700 Mayank Rungta via B4 Relay <devnull+mrungta.google.com@kernel.org> wrote:
> >
> > > All other watchdog pretimeout governors (noop, panic) can be built as
> > > loadable modules. However the "dump" pretimeout governor is restricted
> > > to built-in code because it calls trigger_all_cpu_backtrace(), which
> > > relies on arch_trigger_cpumask_backtrace(), an arch specific helper that
> > > is not exported to loadable modules.
> > >
> > > This 2-patch series allows building the dump governor as a module (=m):
> > > 1) Export cpumask_backtrace() in lib/nmi_backtrace.c.
> > > 2) Convert CONFIG_WATCHDOG_PRETIMEOUT_GOV_DUMP from bool to tristate.
> >
> > LGTM.  Can you please redo against current mainline?  The Kconfig has
> > changed.
> >
> 
> Thanks for the LGTM!
> 
> Regarding rebasing onto mainline (origin/master): The "dump"
> pretimeout governor was added recently by Tzung-Bi Shih ("watchdog:
> pretimeout: Add "dump" pretimeout governor") and is currently in
> linux-next, so it hasn't landed in mainline tree yet.
> 
> Because of this dependency, I based this series on linux-next so that
> patch 2/2 ("Convert dump pretimeout governor to tristate") could apply
> cleanly on top of the new governor.
> 
> Please let me know what is preferred, or if you'd like me to post
> against a different tree!
> 

Oh, OK.

Guenter, can you please process this patchset?

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

* Re: [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module
  2026-07-31 21:01     ` Andrew Morton
@ 2026-07-31 21:19       ` Guenter Roeck
  0 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2026-07-31 21:19 UTC (permalink / raw)
  To: Andrew Morton, Mayank Rungta
  Cc: Mayank Rungta via B4 Relay, Wim Van Sebroeck, Tzung-Bi Shih,
	Douglas Anderson, linux-kernel, linux-watchdog

On 7/31/26 14:01, Andrew Morton wrote:
> On Thu, 30 Jul 2026 16:39:14 -0700 Mayank Rungta <mrungta@google.com> wrote:
> 
>> On Thu, Jul 30, 2026 at 3:50 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>>>
>>> On Thu, 30 Jul 2026 15:00:20 -0700 Mayank Rungta via B4 Relay <devnull+mrungta.google.com@kernel.org> wrote:
>>>
>>>> All other watchdog pretimeout governors (noop, panic) can be built as
>>>> loadable modules. However the "dump" pretimeout governor is restricted
>>>> to built-in code because it calls trigger_all_cpu_backtrace(), which
>>>> relies on arch_trigger_cpumask_backtrace(), an arch specific helper that
>>>> is not exported to loadable modules.
>>>>
>>>> This 2-patch series allows building the dump governor as a module (=m):
>>>> 1) Export cpumask_backtrace() in lib/nmi_backtrace.c.
>>>> 2) Convert CONFIG_WATCHDOG_PRETIMEOUT_GOV_DUMP from bool to tristate.
>>>
>>> LGTM.  Can you please redo against current mainline?  The Kconfig has
>>> changed.
>>>
>>
>> Thanks for the LGTM!
>>
>> Regarding rebasing onto mainline (origin/master): The "dump"
>> pretimeout governor was added recently by Tzung-Bi Shih ("watchdog:
>> pretimeout: Add "dump" pretimeout governor") and is currently in
>> linux-next, so it hasn't landed in mainline tree yet.
>>
>> Because of this dependency, I based this series on linux-next so that
>> patch 2/2 ("Convert dump pretimeout governor to tristate") could apply
>> cleanly on top of the new governor.
>>
>> Please let me know what is preferred, or if you'd like me to post
>> against a different tree!
>>
> 
> Oh, OK.
> 
> Guenter, can you please process this patchset?
> 

Sure. Assuming you'd like me to handle it through the watchdog branch,
it would be great if you can send a formal Acked-by: to the first patch
of the series.

Thanks,
Guenter


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

* Re: [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
  2026-07-31  1:55   ` Doug Anderson
@ 2026-08-01 12:38   ` Tzung-Bi Shih
  2026-08-06 21:41   ` Guenter Roeck
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Tzung-Bi Shih @ 2026-08-01 12:38 UTC (permalink / raw)
  To: mrungta
  Cc: Andrew Morton, Wim Van Sebroeck, Guenter Roeck, Douglas Anderson,
	linux-kernel, linux-watchdog

On Thu, Jul 30, 2026 at 03:00:22PM -0700, Mayank Rungta via B4 Relay wrote:
> From: Mayank Rungta <mrungta@google.com>
> 
> Commit 645ad41da8b2 ("watchdog: pretimeout: Add "dump" pretimeout

FWIW: The hash might have changed due to a rebase.

> governor") added the "dump" watchdog pretimeout governor, but restricted
> it to built-in code because trigger_all_cpu_backtrace() was not exported
> to loadable modules.
> 
> Now that CPU backtrace APIs are supported for loadable kernel modules
> via cpumask_backtrace(), convert WATCHDOG_PRETIMEOUT_GOV_DUMP to
> tristate. This allows kernels to deliver the pretimeout governor as a
> loadable kernel module.
> 
> Signed-off-by: Mayank Rungta <mrungta@google.com>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

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

* Re: [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
  2026-07-31  1:54   ` Doug Anderson
@ 2026-08-06 21:40   ` Guenter Roeck
  2026-08-06 23:44   ` Andrew Morton
  2026-08-07  3:50   ` Guenter Roeck
  3 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2026-08-06 21:40 UTC (permalink / raw)
  To: Mayank Rungta
  Cc: Andrew Morton, Wim Van Sebroeck, Tzung-Bi Shih, Douglas Anderson,
	linux-kernel, linux-watchdog

On Thu, Jul 30, 2026 at 03:00:21PM -0700, Mayank Rungta wrote:
> From: Mayank Rungta <mrungta@google.com>
> 
> Currently, CPU backtrace functions cannot be called from loadable
> modules because the underlying helper arch_trigger_cpumask_backtrace()
> is not exported.
> 
> Instead of exporting arch_trigger_cpumask_backtrace() individually
> across every supported architecture, introduce and export a common
> helper, cpumask_backtrace(), in lib/nmi_backtrace.c. Update the four
> inline CPU backtrace macros in include/linux/nmi.h to route through this
> centralized helper.
> 
> Signed-off-by: Mayank Rungta <mrungta@google.com>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>

Just to give an update: I'd love to apply this and the next patch of the
series, but I can not do wo without formal Ack from a maintainer (I did
that once and got burned for it, so it won't happen again).

I'll send an Ack to the next patch of the series, in case someone else
wants to pick it up.

Guenter

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

* Re: [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
  2026-07-31  1:55   ` Doug Anderson
  2026-08-01 12:38   ` Tzung-Bi Shih
@ 2026-08-06 21:41   ` Guenter Roeck
  2026-08-06 23:44   ` Andrew Morton
  2026-08-07  3:50   ` Guenter Roeck
  4 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2026-08-06 21:41 UTC (permalink / raw)
  To: Mayank Rungta
  Cc: Andrew Morton, Wim Van Sebroeck, Tzung-Bi Shih, Douglas Anderson,
	linux-kernel, linux-watchdog

On Thu, Jul 30, 2026 at 03:00:22PM -0700, Mayank Rungta wrote:
> From: Mayank Rungta <mrungta@google.com>
> 
> Commit 645ad41da8b2 ("watchdog: pretimeout: Add "dump" pretimeout
> governor") added the "dump" watchdog pretimeout governor, but restricted
> it to built-in code because trigger_all_cpu_backtrace() was not exported
> to loadable modules.
> 
> Now that CPU backtrace APIs are supported for loadable kernel modules
> via cpumask_backtrace(), convert WATCHDOG_PRETIMEOUT_GOV_DUMP to
> tristate. This allows kernels to deliver the pretimeout governor as a
> loadable kernel module.
> 
> Signed-off-by: Mayank Rungta <mrungta@google.com>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

As mentioned in the other patch, I can not apply the series without Ack
from a maintainer. In case someone else wants to pick it up instead:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 9f013d774897..922741dd837c 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -99,8 +99,8 @@ config WATCHDOG_PRETIMEOUT_GOV_SEL
>  if WATCHDOG_PRETIMEOUT_GOV
>  
>  config WATCHDOG_PRETIMEOUT_GOV_DUMP
> -	bool "Dump watchdog pretimeout governor"
> -	depends on WATCHDOG_CORE=y
> +	tristate "Dump watchdog pretimeout governor"
> +	depends on WATCHDOG_CORE
>  	default WATCHDOG_CORE
>  	help
>  	  Dump watchdog pretimeout governor, all cpu backtrace is

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

* Re: [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
  2026-07-31  1:54   ` Doug Anderson
  2026-08-06 21:40   ` Guenter Roeck
@ 2026-08-06 23:44   ` Andrew Morton
  2026-08-07  3:50   ` Guenter Roeck
  3 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2026-08-06 23:44 UTC (permalink / raw)
  To: mrungta
  Cc: Mayank Rungta via B4 Relay, Wim Van Sebroeck, Guenter Roeck,
	Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog

On Thu, 30 Jul 2026 15:00:21 -0700 Mayank Rungta via B4 Relay <devnull+mrungta.google.com@kernel.org> wrote:

> From: Mayank Rungta <mrungta@google.com>
> 
> Currently, CPU backtrace functions cannot be called from loadable
> modules because the underlying helper arch_trigger_cpumask_backtrace()
> is not exported.
> 
> Instead of exporting arch_trigger_cpumask_backtrace() individually
> across every supported architecture, introduce and export a common
> helper, cpumask_backtrace(), in lib/nmi_backtrace.c. Update the four
> inline CPU backtrace macros in include/linux/nmi.h to route through this
> centralized helper.

Reviewed-by: Andrew Morton <akpm@linux-foundation.org>


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

* Re: [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
                     ` (2 preceding siblings ...)
  2026-08-06 21:41   ` Guenter Roeck
@ 2026-08-06 23:44   ` Andrew Morton
  2026-08-07  3:50   ` Guenter Roeck
  4 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2026-08-06 23:44 UTC (permalink / raw)
  To: mrungta
  Cc: Mayank Rungta via B4 Relay, Wim Van Sebroeck, Guenter Roeck,
	Tzung-Bi Shih, Douglas Anderson, linux-kernel, linux-watchdog

On Thu, 30 Jul 2026 15:00:22 -0700 Mayank Rungta via B4 Relay <devnull+mrungta.google.com@kernel.org> wrote:

> Commit 645ad41da8b2 ("watchdog: pretimeout: Add "dump" pretimeout
> governor") added the "dump" watchdog pretimeout governor, but restricted
> it to built-in code because trigger_all_cpu_backtrace() was not exported
> to loadable modules.
> 
> Now that CPU backtrace APIs are supported for loadable kernel modules
> via cpumask_backtrace(), convert WATCHDOG_PRETIMEOUT_GOV_DUMP to
> tristate. This allows kernels to deliver the pretimeout governor as a
> loadable kernel module.

Reviewed-by: Andrew Morton <akpm@linux-foundation.org>


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

* Re: [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules
  2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
                     ` (2 preceding siblings ...)
  2026-08-06 23:44   ` Andrew Morton
@ 2026-08-07  3:50   ` Guenter Roeck
  3 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2026-08-07  3:50 UTC (permalink / raw)
  To: Mayank Rungta
  Cc: Andrew Morton, Wim Van Sebroeck, Tzung-Bi Shih, Douglas Anderson,
	linux-kernel, linux-watchdog

On Thu, Jul 30, 2026 at 03:00:21PM -0700, Mayank Rungta wrote:
> From: Mayank Rungta <mrungta@google.com>
> 
> Currently, CPU backtrace functions cannot be called from loadable
> modules because the underlying helper arch_trigger_cpumask_backtrace()
> is not exported.
> 
> Instead of exporting arch_trigger_cpumask_backtrace() individually
> across every supported architecture, introduce and export a common
> helper, cpumask_backtrace(), in lib/nmi_backtrace.c. Update the four
> inline CPU backtrace macros in include/linux/nmi.h to route through this
> centralized helper.
> 
> Signed-off-by: Mayank Rungta <mrungta@google.com>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Reviewed-by: Andrew Morton <akpm@linux-foundation.org>

Applied.

Thanks,
Guenter

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

* Re: [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate
  2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
                     ` (3 preceding siblings ...)
  2026-08-06 23:44   ` Andrew Morton
@ 2026-08-07  3:50   ` Guenter Roeck
  4 siblings, 0 replies; 16+ messages in thread
From: Guenter Roeck @ 2026-08-07  3:50 UTC (permalink / raw)
  To: Mayank Rungta
  Cc: Andrew Morton, Wim Van Sebroeck, Tzung-Bi Shih, Douglas Anderson,
	linux-kernel, linux-watchdog

On Thu, Jul 30, 2026 at 03:00:22PM -0700, Mayank Rungta wrote:
> From: Mayank Rungta <mrungta@google.com>
> 
> Commit 645ad41da8b2 ("watchdog: pretimeout: Add "dump" pretimeout
> governor") added the "dump" watchdog pretimeout governor, but restricted
> it to built-in code because trigger_all_cpu_backtrace() was not exported
> to loadable modules.
> 
> Now that CPU backtrace APIs are supported for loadable kernel modules
> via cpumask_backtrace(), convert WATCHDOG_PRETIMEOUT_GOV_DUMP to
> tristate. This allows kernels to deliver the pretimeout governor as a
> loadable kernel module.
> 
> Signed-off-by: Mayank Rungta <mrungta@google.com>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> Reviewed-by: Andrew Morton <akpm@linux-foundation.org>

Applied.

Thanks,
Guenter

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

end of thread, other threads:[~2026-08-07  3:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30 22:00 [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Mayank Rungta via B4 Relay
2026-07-30 22:00 ` [PATCH 1/2] nmi: Export CPU backtrace APIs for loadable modules Mayank Rungta via B4 Relay
2026-07-31  1:54   ` Doug Anderson
2026-08-06 21:40   ` Guenter Roeck
2026-08-06 23:44   ` Andrew Morton
2026-08-07  3:50   ` Guenter Roeck
2026-07-30 22:00 ` [PATCH 2/2] watchdog: pretimeout: Convert dump pretimeout governor to tristate Mayank Rungta via B4 Relay
2026-07-31  1:55   ` Doug Anderson
2026-08-01 12:38   ` Tzung-Bi Shih
2026-08-06 21:41   ` Guenter Roeck
2026-08-06 23:44   ` Andrew Morton
2026-08-07  3:50   ` Guenter Roeck
2026-07-30 22:50 ` [PATCH 0/2] watchdog: pretimeout: Allow building dump governor as module Andrew Morton
2026-07-30 23:39   ` Mayank Rungta
2026-07-31 21:01     ` Andrew Morton
2026-07-31 21:19       ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox