]> git.hungrycats.org Git - linux/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:01:06 +0000 (12:01 +0200)
commit3670051acbca6537641c6033ae31e51110812ad8
tree48b87d68b2b2ddd938a7be417ddb467b8919e807
parenta0d9c0cd5856191e095cf43a2e141b73945b7716
tracing/timerlat: Fix duplicated kthread creation due to CPU online/offline

commit 0bb0a5c12ecf36ad561542bbb95f96355e036a02 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_osnoise.c