[Devel] [PATCH RHEL8 COMMIT] ms/tracing: remove WARN_ON in start_thread()

Konstantin Khorenko khorenko at virtuozzo.com
Tue Dec 22 16:44:33 MSK 2020


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.3
------>
commit df45cae70ccd9baddd35f22abcd43dc01f78e3c2
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Fri Nov 20 09:27:18 2020 +0300

    ms/tracing: remove WARN_ON in start_thread()
    
    This patch reverts upstream commit 978defee11a5 ("tracing: Do a WARN_ON()
     if start_thread() in hwlat is called when thread exists")
    
    .start hook can be legally called several times if according
    tracer is stopped
    
    screen window 1
    [root at localhost ~]# echo 1 > /sys/kernel/tracing/events/kmem/kfree/enable
    [root at localhost ~]# echo 1 > /sys/kernel/tracing/options/pause-on-trace
    [root at localhost ~]# less -F /sys/kernel/tracing/trace
    
    screen window 2
    [root at localhost ~]# cat /sys/kernel/debug/tracing/tracing_on
    0
    [root at localhost ~]# echo hwlat >  /sys/kernel/debug/tracing/current_tracer
    [root at localhost ~]# echo 1 > /sys/kernel/debug/tracing/tracing_on
    [root at localhost ~]# cat /sys/kernel/debug/tracing/tracing_on
    0
    [root at localhost ~]# echo 2 > /sys/kernel/debug/tracing/tracing_on
    
    triggers warning in dmesg:
    WARNING: CPU: 3 PID: 1403 at kernel/trace/trace_hwlat.c:371 hwlat_tracer_start+0xc9/0xd0
    
    mFixes: 978defee11a5 ("tracing: Do a WARN_ON() if start_thread() in hwlat is
    called when thread exists")
    
    ms commit: 310e3a4b5a4f ("tracing: Remove WARN_ON in start_thread()")
    
    https://jira.sw.ru/browse/PSBM-120940
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 kernel/trace/trace_hwlat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index bccff460cd35..af8c26d5642a 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -354,7 +354,7 @@ static int start_kthread(struct trace_array *tr)
 	struct task_struct *kthread;
 	int next_cpu;
 
-	if (WARN_ON(hwlat_kthread))
+	if (hwlat_kthread)
 		return 0;
 
 	/* Just pick the first CPU on first iteration */


More information about the Devel mailing list