tracing/timerlat: Fix duplicated kthread creation due to CPU online/offline
authorWei Li <liwei391@huawei.com>
Tue, 24 Sep 2024 09:45:11 +0000 (17:45 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 3 Oct 2024 20:43:22 +0000 (16:43 -0400)
commit0bb0a5c12ecf36ad561542bbb95f96355e036a02
tree5c2bcfb85338faf0b03188fb921ca4387975d578
parentad686707ea16099a791bcdcd5372764c5059aecc
tracing/timerlat: Fix duplicated kthread creation due to CPU online/offline

osnoise_hotplug_workfn() is the asynchronous online callback for
"trace/osnoise:online". It may be congested when a CPU goes online and
offline repeatedly and is invoked for multiple times after a certain
online.

This will lead to kthread leak and timer corruption. Add a check
in start_kthread() to prevent this situation.

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20240924094515.3561410-2-liwei391@huawei.com
Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations")
Signed-off-by: Wei Li <liwei391@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_osnoise.c