Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp405761pxb; Thu, 21 Oct 2021 01:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNjHKY1XlYwf5l/B94+6fBetJPKGDnEdYPBdapQpJa2YUuhBrAonNukjlLoLlQgjgUV8Vd X-Received: by 2002:a17:903:11c9:b0:13f:f28f:f77 with SMTP id q9-20020a17090311c900b0013ff28f0f77mr3274935plh.79.1634805948961; Thu, 21 Oct 2021 01:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634805948; cv=none; d=google.com; s=arc-20160816; b=Yo4REyG0MkImmeYp8IpY73w6MWlDOdLvOxfHwXIBlLxFPVHlC+DhfMdlwFyEUx4Lu1 3nqBndMFoJvGnC6zRiWkupQakw7c4dYOBdHzbJcMupTYm0eEjSj0ZeZwtTVPJyKPiY1b fShoIUIE0cJ3tK9sqsqntAXm0Q7FAkFBrSGzUW3RPPyqlcnEBbxdnQwUFCSZG58b88lA cVbHBVVgCBsj5gj35dccYCmneP1Ir3aEgaQ0rtlpF4qw4Efmx8dS1aIdO5R4Trsn+fbk HKbFyh+skDT0aO5Epa9C7swfPWLKHvaTPvwJT/nRqGg1Sk/EVpI8KBAyrV0YqojgribR aQ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=WuNV/gbusCwkGZZbiZzS7lhbeeRIEVso2nbjlpvxc5o=; b=04RZp4dbeQ0H8WrBOr9jl65okyCcpjBo5TojfpMagyn5yQY/nxajixpk6WSGU9cTAw kRoqPiIUw4E3p0WPPz8lttE+cc/ty4SFafeKN6/QR/ERTAQqJNc08OmjaMkZyw4s98Bf /SxBNSDqpiieZC2ws8szeHRu9mtzCgOQLpRRcqFTejVsrm7DK+EQ4seOpCmd/uXIdBJ2 Qz2z/n9jo83SiGOGUrMlPvyh6V+8patxBu/1FgdXjW59iGogP50FpQylWlFQIJefNlQP qO+xmUCqf+mhSStoNSoIWHeTXcTGQSK5swGtitDbQhh0SPxLwASjb6xPQJwAozpDn7eM qHfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si6297651pfv.162.2021.10.21.01.45.35; Thu, 21 Oct 2021 01:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231495AbhJUIq1 (ORCPT + 99 others); Thu, 21 Oct 2021 04:46:27 -0400 Received: from mx22.baidu.com ([220.181.50.185]:48118 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231561AbhJUIqZ (ORCPT ); Thu, 21 Oct 2021 04:46:25 -0400 Received: from BJHW-MAIL-EX04.internal.baidu.com (unknown [10.127.64.14]) by Forcepoint Email with ESMTPS id B99EBDF23E9D9951F456; Thu, 21 Oct 2021 16:44:08 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-MAIL-EX04.internal.baidu.com (10.127.64.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 16:44:08 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 21 Oct 2021 16:44:08 +0800 From: Cai Huoqing To: CC: "Michael S. Tsirkin" , Jason Wang , , , , Subject: [PATCH] vhost: Make use of the helper macro kthread_run() Date: Thu, 21 Oct 2021 16:44:06 +0800 Message-ID: <20211021084406.2660-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-EX02.internal.baidu.com (172.31.51.42) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing --- drivers/vhost/vhost.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 59edb5a1ffe2..e67bd5603b5f 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -595,15 +595,15 @@ 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, - "vhost-%d", current->pid); + /* avoid contributing to loadavg */ + worker = kthread_run(vhost_worker, dev, + "vhost-%d", current->pid); if (IS_ERR(worker)) { err = PTR_ERR(worker); goto err_worker; } dev->worker = worker; - wake_up_process(worker); /* avoid contributing to loadavg */ err = vhost_attach_cgroups(dev); if (err) -- 2.25.1