mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 12:14:10 +08:00
ring-buffer: make use of the helper function kthread_run_on_cpu()
Replace kthread_create/kthread_bind/wake_up_process() with kthread_run_on_cpu() to simplify the code. Link: https://lkml.kernel.org/r/20211022025711.3673-4-caihuoqing@baidu.com Signed-off-by: Cai 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
e085011393
commit
64ed3a049e
@ -5898,16 +5898,13 @@ static __init int test_ringbuffer(void)
|
||||
rb_data[cpu].buffer = buffer;
|
||||
rb_data[cpu].cpu = cpu;
|
||||
rb_data[cpu].cnt = cpu;
|
||||
rb_threads[cpu] = kthread_create(rb_test, &rb_data[cpu],
|
||||
"rbtester/%d", cpu);
|
||||
rb_threads[cpu] = kthread_run_on_cpu(rb_test, &rb_data[cpu],
|
||||
cpu, "rbtester/%u");
|
||||
if (WARN_ON(IS_ERR(rb_threads[cpu]))) {
|
||||
pr_cont("FAILED\n");
|
||||
ret = PTR_ERR(rb_threads[cpu]);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
kthread_bind(rb_threads[cpu], cpu);
|
||||
wake_up_process(rb_threads[cpu]);
|
||||
}
|
||||
|
||||
/* Now create the rb hammer! */
|
||||
|
Loading…
Reference in New Issue
Block a user