Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADE9BC636D6 for ; Thu, 9 Feb 2023 19:18:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjBITSe (ORCPT ); Thu, 9 Feb 2023 14:18:34 -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 ); 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 To: live-patching@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Seth Forshee , Peter Zijlstra , Song Liu , Mark Rutland , Petr Mladek , Joe Lawrence , Miroslav Benes , Jiri Kosina , Ingo Molnar 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: References: MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) Link: https://lkml.kernel.org/lkml/20230120-vhost-klp-switching-v1-0-7c2b65519c43@kernel.org Signed-off-by: Josh Poimboeuf --- 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 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); -- 2.39.0