Re: [RFC] watchdog: pretimeout: add a notifier call chain governor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guenter,

Thanks a lot for the fast feedback!

On Tue, Apr 13, 2021 at 09:15:35AM -0700, Guenter Roeck wrote:
> On 4/13/21 8:45 AM, Stefan Eichenberger wrote:
> > Add a governor which calls a notifier call chain. This allows the
> > registration of custom functions to the watchdog pretimeout. This is
> > useful when writing out-of-tree kernel modules and it is more similar to
> > the register_reboot_notifier or register_oom_notifier API.
> > 
> > Signed-off-by: Stefan Eichenberger <eichest@xxxxxxxxx>
> 
> It seems questionable to implement such a notification as governor.
> A governor is configurable, and letting userspace override notifications
> seems very odd and unusual. Please provide a use case.

What I would like to do is to have an out-of-tree module which will
write a pattern into a reserved memory region when a watchdog occurs.
After a reboot the module then read this reserved memory region and can
differentiate between different reset reasons. Here the example kernel
module:
https://github.com/embear-engineering/sample-kernel-modules/blob/use-watchdog-register/reset-reason/reset-reason.c

Registering to the watchdog happens on line 180.

I think I could just implement a governor in the module but it is not
really flexible because then I would have to compile the kernel with
e.g. the noop governor and then switch to my governor after the module
loaded. Then I thought why not using a notifier chain similar to reboot,
panic, or oom.

Regards,
Stefan




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux