]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lib: test_objpool: Use kthread_run_on_cpu()
authorFrederic Weisbecker <frederic@kernel.org>
Thu, 26 Sep 2024 22:48:57 +0000 (00:48 +0200)
committerFrederic Weisbecker <frederic@kernel.org>
Thu, 2 Jan 2025 21:12:12 +0000 (22:12 +0100)
Use the proper API instead of open coding it.

Reviewed-by: Matt Wu <wuqiang.matt@bytedance.com>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
lib/test_objpool.c

index 5a3f6961a70fac4a2d1518cb2d74b63591ed0b54..896c0131c9a8c36b8538b55fa0eacda5c87a0f28 100644 (file)
@@ -371,14 +371,10 @@ static int ot_start_sync(struct ot_test *test)
                if (!cpu_online(cpu))
                        continue;
 
-               work = kthread_create_on_node(ot_thread_worker, item,
-                               cpu_to_node(cpu), "ot_worker_%d", cpu);
-               if (IS_ERR(work)) {
+               work = kthread_run_on_cpu(ot_thread_worker, item,
+                                         cpu, "ot_worker_%d");
+               if (IS_ERR(work))
                        pr_err("failed to create thread for cpu %d\n", cpu);
-               } else {
-                       kthread_bind(work, cpu);
-                       wake_up_process(work);
-               }
        }
 
        /* wait a while to make sure all threads waiting at start line */
@@ -562,14 +558,9 @@ static int ot_start_async(struct ot_test *test)
                if (!cpu_online(cpu))
                        continue;
 
-               work = kthread_create_on_node(ot_thread_worker, item,
-                               cpu_to_node(cpu), "ot_worker_%d", cpu);
-               if (IS_ERR(work)) {
+               work = kthread_run_on_cpu(ot_thread_worker, item, cpu, "ot_worker_%d");
+               if (IS_ERR(work))
                        pr_err("failed to create thread for cpu %d\n", cpu);
-               } else {
-                       kthread_bind(work, cpu);
-                       wake_up_process(work);
-               }
        }
 
        /* wait a while to make sure all threads waiting at start line */