[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAD=FV=VrFw42KRfR=ysP=MSWnukQGnwGwoAu310TG3KUU9cp3w@mail.gmail.com>
Date: Wed, 28 Jan 2026 09:45:36 -0800
From: Doug Anderson <dianders@...omium.org>
To: Qiliang Yuan <realwujing@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>, Li Huafei <lihuafei1@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>, Jinchao Wang <wangjinchao600@...il.com>,
Thorsten Blum <thorsten.blum@...ux.dev>, Yicong Yang <yangyicong@...ilicon.com>,
linux-watchdog@...r.kernel.org, mm-commits@...r.kernel.org,
Shouxin Sun <sunshx@...natelecom.cn>, Junnan Zhang <zhangjn11@...natelecom.cn>,
Qiliang Yuan <yuanql9@...natelecom.cn>, Song Liu <song@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8] watchdog/hardlockup: simplify perf event probe and
remove per-cpu dependency
Hi,
On Wed, Jan 28, 2026 at 5:29 AM Qiliang Yuan <realwujing@...il.com> wrote:
>
> Simplify the hardlockup detector's probe path and remove its implicit
> dependency on pinned per-cpu execution.
>
> Refactor hardlockup_detector_event_create() to be stateless. Return
> the created perf_event pointer to the caller instead of directly
> modifying the per-cpu 'watchdog_ev' variable. This allows the probe
> path to safely manage a temporary event without the risk of leaving
> stale pointers should task migration occur.
>
> Signed-off-by: Shouxin Sun <sunshx@...natelecom.cn>
> Signed-off-by: Junnan Zhang <zhangjn11@...natelecom.cn>
> Signed-off-by: Qiliang Yuan <yuanql9@...natelecom.cn>
> Signed-off-by: Qiliang Yuan <realwujing@...il.com>
> Cc: Douglas Anderson <dianders@...omium.org>
> Cc: Song Liu <song@...nel.org>
> Cc: Jinchao Wang <wangjinchao600@...il.com>
> ---
> v8:
> - Add Signed-off-by with work email.
> - v7 link: https://lore.kernel.org/all/20260128060833.1715622-1-realwujing@gmail.com/
> v7:
> - Update Signed-off-by to match author email.
> - Remove redundant cpu_hotplug_disable() in probe path.
> - v6 link: https://lore.kernel.org/all/20260128023136.1691973-1-realwujing@gmail.com/
> v6:
> - Change title to "simplify/cleanup" and remove "Fixes" tag since the issue
> is not reproducible on mainline.
> - Rewrite commit message in imperative mood.
> - Clarify that mainline is safe while this improves robustness.
> - v5 link: https://lore.kernel.org/all/20260127022238.1182079-1-realwujing@gmail.com/
> v5:
> - Refine description: clarify that the retry path uses worker threads
> without PF_PERCPU_THREAD (though mainline is safe due to system_percpu_wq).
> - v4 link: https://lore.kernel.org/all/20260124070814.806828-1-realwujing@gmail.com/
> v4:
> - Add cpu_hotplug_disable() in watchdog_hardlockup_probe() to stabilize
> the probe CPU.
> - Update description to explain the relevance of 4.19 logs.
> v3:
> - Refactor hardlockup_detector_event_create() to be stateless by returning
> the event pointer instead of directly assigning to per-cpu variables.
> - Restore PMU cycle fallback and unify the enable/probe paths.
> v2:
> - Add Cc: stable@...r.kernel.org.
> v1:
> - Avoid 'watchdog_ev' in probe path by manually creating and releasing a
> local perf event.
>
> kernel/watchdog_perf.c | 51 ++++++++++++++++++++++++------------------
> 1 file changed, 29 insertions(+), 22 deletions(-)
>
> diff --git a/kernel/watchdog_perf.c b/kernel/watchdog_perf.c
> index d3ca70e3c256..4a798443033b 100644
> --- a/kernel/watchdog_perf.c
> +++ b/kernel/watchdog_perf.c
> @@ -17,6 +17,7 @@
> #include <linux/atomic.h>
> #include <linux/module.h>
> #include <linux/sched/debug.h>
> +#include <linux/cpu.h>
IIRC, the above include was added for the call to
cpu_hotplug_disable(), which has now been removed. The #include can be
removed now, right?
In any case:
Reviewed-by: Douglas Anderson <dianders@...omium.org>
Powered by blists - more mailing lists