From: Tero Kristo Date: Fri, 10 Mar 2023 10:04:50 +0000 (+0200) Subject: trace/hwlat: Do not wipe the contents of per-cpu thread data X-Git-Tag: baikal/mips/sdk6.1~24 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f269eaf828f8a28e2f01fe4761ab0a7fe2d9a966;p=kernel.git trace/hwlat: Do not wipe the contents of per-cpu thread data commit 5a4caae5c70a8a234a4f796ce0c01a9925a5aa79 upstream. Do not wipe the contents of the per-cpu kthread data when starting the tracer, as this will completely forget about already running instances and can later start new additional per-cpu threads. Link: https://lore.kernel.org/all/20230302113654.2984709-1-tero.kristo@linux.intel.com/ Link: https://lkml.kernel.org/r/20230310100451.3948583-2-tero.kristo@linux.intel.com Cc: stable@vger.kernel.org Fixes: 17685413db7ee ("trace/hwlat: Implement the per-cpu mode") Signed-off-by: Tero Kristo Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c index d440ddd5fd8b2..edc26dc22c3f1 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -584,9 +584,6 @@ static int start_per_cpu_kthreads(struct trace_array *tr) */ cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask); - for_each_online_cpu(cpu) - per_cpu(hwlat_per_cpu_data, cpu).kthread = NULL; - for_each_cpu(cpu, current_mask) { retval = start_cpu_kthread(cpu); if (retval)