Commit 11e4e352 authored by Cai Huoqing's avatar Cai Huoqing Committed by Linus Torvalds

trace/osnoise: make use of the helper function kthread_run_on_cpu()

Replace kthread_create_on_cpu/wake_up_process() with kthread_run_on_cpu()
to simplify the code.

Link: https://lkml.kernel.org/r/20211022025711.3673-6-caihuoqing@baidu.comSigned-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3b9cb4ba
...@@ -1701,7 +1701,7 @@ static int start_kthread(unsigned int cpu) ...@@ -1701,7 +1701,7 @@ static int start_kthread(unsigned int cpu)
snprintf(comm, 24, "osnoise/%d", cpu); snprintf(comm, 24, "osnoise/%d", cpu);
} }
kthread = kthread_create_on_cpu(main, NULL, cpu, comm); kthread = kthread_run_on_cpu(main, NULL, cpu, comm);
if (IS_ERR(kthread)) { if (IS_ERR(kthread)) {
pr_err(BANNER "could not start sampling thread\n"); pr_err(BANNER "could not start sampling thread\n");
...@@ -1710,7 +1710,6 @@ static int start_kthread(unsigned int cpu) ...@@ -1710,7 +1710,6 @@ static int start_kthread(unsigned int cpu)
} }
per_cpu(per_cpu_osnoise_var, cpu).kthread = kthread; per_cpu(per_cpu_osnoise_var, cpu).kthread = kthread;
wake_up_process(kthread);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment