From mboxrd@z Thu Jan 1 00:00:00 1970 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 A2B4CC38142 for ; Fri, 27 Jan 2023 17:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbjA0RLI (ORCPT ); Fri, 27 Jan 2023 12:11:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234883AbjA0RLF (ORCPT ); Fri, 27 Jan 2023 12:11:05 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC2554C18; Fri, 27 Jan 2023 09:10:38 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0490961D04; Fri, 27 Jan 2023 17:09:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8AE9C433EF; Fri, 27 Jan 2023 17:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674839388; bh=gWUbK0c4RR1yn+JaQjbB3L0M42JkQ49jpNPbeYG/EdM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CGkMbCd86HIzYSIxgC+1VgVYp54QrgxBmiEjocBcjp0sg+YSRkNmyKk13FqRwexef SJtzeQyp/QhZ0KuciAFJl/uap4GKzAqnZid+yxpHF+vY7zdmFABQRp8axWxLOjhQlf fKdZa3Phz5tkAbXH3fw7TPdM+tAZiT7C1YlSKVndjGHS7YKzDPFLNeau7OpcdCIjXY 0AQtAHtaIwGy8fwTvA7C9nMxVar+8QbL1hXaWcIgs/ZBijm0kHH8cv8+JZO0DrBar5 gF8CfW2EJLX3/P/R41YmQmWVuW02IbXVYEHFW1GGvqCUrxQUZLAuivKb4FZXbAzf2s GHoylZp3RdSdQ== Date: Fri, 27 Jan 2023 09:09:46 -0800 From: Josh Poimboeuf To: Peter Zijlstra Cc: Petr Mladek , Joe Lawrence , kvm@vger.kernel.org, "Michael S. Tsirkin" , netdev@vger.kernel.org, Jiri Kosina , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, "Seth Forshee (DigitalOcean)" , live-patching@vger.kernel.org, Miroslav Benes Subject: Re: [PATCH 0/2] vhost: improve livepatch switching for heavily loaded vhost worker kthreads Message-ID: <20230127170946.zey6xbr4sm4kvh3x@treble> References: <20230120-vhost-klp-switching-v1-0-7c2b65519c43@kernel.org> <20230127044355.frggdswx424kd5dq@treble> <20230127165236.rjcp6jm6csdta6z3@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230127165236.rjcp6jm6csdta6z3@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 27, 2023 at 08:52:38AM -0800, Josh Poimboeuf wrote: > On Fri, Jan 27, 2023 at 11:37:02AM +0100, Peter Zijlstra wrote: > > On Thu, Jan 26, 2023 at 08:43:55PM -0800, Josh Poimboeuf wrote: > > > Here's another idea, have we considered this? Have livepatch set > > > TIF_NEED_RESCHED on all kthreads to force them into schedule(), and then > > > have the scheduler call klp_try_switch_task() if TIF_PATCH_PENDING is > > > set. > > > > > > Not sure how scheduler folks would feel about that ;-) > > Hmmmm, with preemption I guess the above doesn't work for kthreads > calling cond_resched() instead of what vhost_worker() does (explicit > need_resched/schedule). Though I guess we could hook into cond_resched() too if we make it a non-NOP for PREEMPT+LIVEPATCH? -- Josh