Message ID | 76622971662bbd42abc9a1b25a73a8c3ac929ca3.1675969869.git.jpoimboe@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp527013wrn; Thu, 9 Feb 2023 11:24:13 -0800 (PST) X-Google-Smtp-Source: AK7set+YG+1XYmg/I4VqxX0lx55iQ/8d506QsVIYcdg+UX4EAaerrsKvFK1D+wSMXPVSxJR1+Zd+ X-Received: by 2002:a50:9554:0:b0:4ab:25d7:8cec with SMTP id v20-20020a509554000000b004ab25d78cecmr1270093eda.30.1675970653209; Thu, 09 Feb 2023 11:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675970653; cv=none; d=google.com; s=arc-20160816; b=QHSIfofbEagne94rTA7xZuG2jSD0QQxCNIlshPpwtpf1ahyehGwGVx52Zf+UG0w3h3 4a3b7n1k7c84H6GVrW5LFiW5e3riYmKwQNU2CGe26szyYl2GBp3pbeTgLCJuWe9bvoum fCk0VFMYVfBKcbt/udH6Xj2aMKj+0yHcUqeptYMxbZ1ilffoBEgKS5EuB279s6sd0VHc 3xMrwUNOl5mbf4uihfqXSsDT50nT2RwSRLrY+btKoEJfXLYTJy5S4b22e/VCmqP8xc3v KE4MghP+w0PB4xE7b3BSBkqLKb9mpLovgExmMkTbXxuspqabosbHtc4hl5nh71TUUSE1 ELaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1YwVVMwfkejb2PKVgntMKS/xxiJWK+Thf4NDrYceLI8=; b=VecjC7RBh0y5E+HAFUK2Es2AvGH0zl9QK3dwRMzSdPnaZIXViGYAbnHw4nlcK3F81v kXlPQojH2mN2ElS+DX154RZE7TbtidqEIbLW63bhoXSNYJc7NLBomvPw5akwkiETsSqU C2xNrUWO28ipTGG9DcClNamvFUcAWx7e8l4n82Bk7On7MRfNq+XBHDXuwsktf/A/3b+b MrhtNrFsE1lCV5k1pUlUtiaAITJcdWqJLkp/F7/hw/zZrMCwcrqVrX6eEb+mw//Elpxq XSvOPJe6/+skA18ZDrrAmM5pri7j0q4Dd9Tzi2qnWjyExDZJs8tE+BoaF5XZx0ITeb+q dttw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HhkyRF/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l10-20020aa7d94a000000b004a23153d992si3103057eds.238.2023.02.09.11.23.49; Thu, 09 Feb 2023 11:24:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="HhkyRF/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjBITSd (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 14:18:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbjBITS2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 14:18:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67CED6A70A; Thu, 9 Feb 2023 11:18:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F1D84B82292; Thu, 9 Feb 2023 19:18:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37C81C4339C; Thu, 9 Feb 2023 19:18:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675970304; bh=NKdf/DmfCqhfyz+hBsxyGBbopa789ZG35qd6K94RXng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HhkyRF/zpOvo8qUME/yQOqPMB6OJmc0Y3wrOPwQq1Vr/2TcutOLZE3GpTVo62y4lO 2gvB4xNDXS2ufFFu5kXwzZNoOiQS/i9vMVtPDplVuPySNv9x+R47NjGWT0+1wXpQok aMFqCqjmZQ5f9fvJATem7WCQgWTDMfNQzUCS95WFr8LOtYhZ3m162G1Y661kqo9tBR F14sKAf4/89QjrMiQR3lfp8hdrWL5mBMywnjI854U/NXvcLJ6kl6JZoEHH8L4x1ReU 4uD1foRL8a9CDRhcg3d9BIUdU0btJTfSohGG6D5VhDEMNxmUIZMvgA4jNofd5vrdlo AzeyI4X9Xs/dA== From: Josh Poimboeuf <jpoimboe@kernel.org> To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Seth Forshee <sforshee@digitalocean.com>, Peter Zijlstra <peterz@infradead.org>, Song Liu <song@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Petr Mladek <pmladek@suse.com>, Joe Lawrence <joe.lawrence@redhat.com>, Miroslav Benes <mbenes@suse.cz>, Jiri Kosina <jikos@kernel.org>, Ingo Molnar <mingo@redhat.com> Subject: [PATCH 3/3] vhost: Fix livepatch timeouts in vhost_worker() Date: Thu, 9 Feb 2023 11:17:49 -0800 Message-Id: <76622971662bbd42abc9a1b25a73a8c3ac929ca3.1675969869.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <cover.1675969869.git.jpoimboe@kernel.org> References: <cover.1675969869.git.jpoimboe@kernel.org> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757382604004396718?= X-GMAIL-MSGID: =?utf-8?q?1757382604004396718?= |
Series |
livepatch,sched: Add livepatch task switching to cond_resched()
|
|
Commit Message
Josh Poimboeuf
Feb. 9, 2023, 7:17 p.m. UTC
Livepatch timeouts were reported due to busy vhost_worker() kthreads.
Now that cond_resched() can do livepatch task switching, use
cond_resched() in vhost_worker(). That's the better way to
conditionally call schedule() anyway.
Reported-by: Seth Forshee (DigitalOcean) <sforshee@digitalocean.com>
Link: https://lkml.kernel.org/lkml/20230120-vhost-klp-switching-v1-0-7c2b65519c43@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
drivers/vhost/vhost.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Thu 2023-02-09 11:17:49, Josh Poimboeuf wrote: > Livepatch timeouts were reported due to busy vhost_worker() kthreads. > Now that cond_resched() can do livepatch task switching, use > cond_resched() in vhost_worker(). That's the better way to > conditionally call schedule() anyway. > > Reported-by: Seth Forshee (DigitalOcean) <sforshee@digitalocean.com> > Link: https://lkml.kernel.org/lkml/20230120-vhost-klp-switching-v1-0-7c2b65519c43@kernel.org > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Reviewed-by: Petr Mladek <pmladek@suse.com> Best Regards, Petr
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index cbe72bfd2f1f..424c0c939f57 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -363,8 +363,7 @@ static int vhost_worker(void *data) kcov_remote_start_common(dev->kcov_handle); work->fn(work); kcov_remote_stop(); - if (need_resched()) - schedule(); + cond_resched(); } } kthread_unuse_mm(dev->mm);