Re: [PATCH] watchdog: move nmi_watchdog sysctl into .rodata
From: Petr Mladek
Date: Mon Oct 06 2025 - 11:06:29 EST
On Mon 2025-09-29 17:55:07, Joel Granados wrote:
> Move nmi_watchdog into the watchdog_sysctls array to prevent it from
> unnecessary modification. This move effectively moves it inside the
> .rodata section.
>
> Initially moved out into its own non-const array in commit 9ec272c586b0
> ("watchdog/hardlockup: keep kernel.nmi_watchdog sysctl as 0444 if probe
> fails"), which made it writable only when watchdog_hardlockup_available
> was true. Moving it back to watchdog_sysctl keeps this behavior as
> writing to nmi_watchdog still fails when watchdog_hardlockup_available
> is false.
>
> Signed-off-by: Joel Granados <joel.granados@xxxxxxxxxx>
The patch looks good to me. Updating the access rights was nice to
have. But it does not look not worth complicating the constification.
And proc_nmi_watchdog() works correctly even when the access rights
are always 0644.
Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
Best Regards,
Petr