lkml.org 
[lkml]   [2022]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] vhost: Make use of the helper macro kthread_run()
Date
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Yin Xiujiang <yinxiujiang@kylinos.cn>
---
drivers/vhost/vhost.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 59edb5a1ffe2..19e9eda9fc71 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -595,7 +595,7 @@ long vhost_dev_set_owner(struct vhost_dev *dev)

dev->kcov_handle = kcov_common_handle();
if (dev->use_worker) {
- worker = kthread_create(vhost_worker, dev,
+ worker = kthread_run(vhost_worker, dev,
"vhost-%d", current->pid);
if (IS_ERR(worker)) {
err = PTR_ERR(worker);
@@ -603,7 +603,6 @@ long vhost_dev_set_owner(struct vhost_dev *dev)
}

dev->worker = worker;
- wake_up_process(worker); /* avoid contributing to loadavg */

err = vhost_attach_cgroups(dev);
if (err)
--
2.30.0
\
 
 \ /
  Last update: 2022-01-27 03:09    [W:0.348 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site