Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6324628iob; Tue, 10 May 2022 16:02:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxS+0dFsLIsv4iqAPwbR5xf3AdNssD9Sq9dFPOXdf2uwbcVqiYU9VaICTqMGFX9YNNutuMc X-Received: by 2002:a17:906:2314:b0:6f4:d3d0:9ede with SMTP id l20-20020a170906231400b006f4d3d09edemr21609248eja.765.1652223764089; Tue, 10 May 2022 16:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652223764; cv=none; d=google.com; s=arc-20160816; b=e71b4+USHDQEmIJOjvK+HKQMfA6gF2TlVBiET8qUuYV8IQt++qs9OzkYfFmwNnsnh6 CQ4QDt4BFA7/fyWsR1yPNqJE6mtNehyiOZL3qB4eDi7VDiSgfd3pJMGly8FGdOfvFFJt oC1nT09ZUiFtBnyVoi47Zvx06yYimNzdlGdu7ltgjjLFoONpt167EjPdKt3afKjeQZj7 hXrfcZLs3ou86ck7AY7EigkaIoazzhFuSkorfF87ipbwGNbEReXOMlHBd8CQB02Po+Xh wGB3jiuX+JEwWDcEGkQf+atOhW0RTThn/wb66+lSdLZE6jksonkWG7J7zmZ7/9eYj/Pp Am7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pW6WBO5Q+Edaoegjq0OrCp9aKsso3jdjkPqFbbm5NWY=; b=cnQT1bK2B8GOjxT1HhoT7/xyMpC9AVbuIt4zG/7sxb0uDwWW5v6LFVTcEE2xEUuTox yWP+9RS4+CtxlBxIRH5xOVeTgF6kVoPsl1kKQxiDOY3/1cgLc9VLnQBOIdvQ+o70nOc5 67fkwxSUweo9oPkP1SFNYjVMPqqXvceelfO0SZ1e22DMcbhKqh6JYk48NL8jd0QFPZnO GFbKQGogF2yw4lhpkOYQxo3oXS4OZdanuMi6xarvVIgM9Ch6Qmt8lX0FInaRkU/cSOZO 57qQKjMKrQd2NA9dlq2RBBMVK9p4+nyCLsd4ezoogyckMa7UlI818Ho/IEhR0JnfSvEB K81A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DOiuH0NV; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk36-20020a1709077fa400b006f3d0d3aa1esi768312ejc.101.2022.05.10.16.02.17; Tue, 10 May 2022 16:02:44 -0700 (PDT) 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=DOiuH0NV; 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 S1348570AbiEJSma (ORCPT + 99 others); Tue, 10 May 2022 14:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243004AbiEJSmS (ORCPT ); Tue, 10 May 2022 14:42:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA2DF268669; Tue, 10 May 2022 11:42:17 -0700 (PDT) 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 81C74B81F8E; Tue, 10 May 2022 18:42:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C043CC385C2; Tue, 10 May 2022 18:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652208135; bh=v9assGn8KJvRcYSGGwT4yY/3QErO+MifFnTskNJEOJs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DOiuH0NVr/M/+D5cGKtA0J1jPwNc7Q8iGoTIHw/Md93ZJ9xbOK2Ywccrswpf+c1dl eKMzThtVr/hgf5FfUOj7+nCl8EARsp8oJ+Q6SwDhDrxMyEP+r0RPy+WlaoX9t7VNOC llRIBpGK6tQ1GrdjtW081wS+TpLpCLyYg/qvj4C0JAnTlwr0/QtIbSprwj7+MO4S7d h6byhmIWcZdfbOZzTEESvxHVQcl9rXmuxi5hq3HkhG5oMY0/tVZWe/Uw3lcG3Tc/QG TtFuJKiVDAwisMzTPzG0YlDePMN/CkoBZ8qh2L+ljj0ClNXh1RMpumcWP2GgOGWQSr jpyz2ShXwNNFg== Date: Tue, 10 May 2022 11:42:13 -0700 From: Josh Poimboeuf To: Rik van Riel Cc: "song@kernel.org" , "joe.lawrence@redhat.com" , Song Liu , "peterz@infradead.org" , "mingo@redhat.com" , "vincent.guittot@linaro.org" , "pmladek@suse.com" , "live-patching@vger.kernel.org" , Kernel Team , "linux-kernel@vger.kernel.org" , "jpoimboe@redhat.com" Subject: Re: [RFC] sched,livepatch: call klp_try_switch_task in __cond_resched Message-ID: <20220510184213.l3gjweeleyg7obca@treble> References: <20220507174628.2086373-1-song@kernel.org> <9C7DF147-5112-42E7-9F7C-7159EFDFB766@fb.com> <3a9bfb4a52b715bd8739d8834409c9549ec7f22f.camel@fb.com> <6bf85ff908377508a5f5bcc7c4e75d598b96f388.camel@fb.com> <20220510165244.ikfh64ertnvodxb4@treble> <1bd15361edfd4db9fc9271d35e7bbe5edad1b87a.camel@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1bd15361edfd4db9fc9271d35e7bbe5edad1b87a.camel@fb.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 10, 2022 at 06:07:00PM +0000, Rik van Riel wrote: > On Tue, 2022-05-10 at 09:52 -0700, Josh Poimboeuf wrote: > > On Tue, May 10, 2022 at 04:07:42PM +0000, Rik van Riel wrote: > > > > > > > Now I wonder if we could just hook up a preempt notifier > > > for kernel live patches. All the distro kernels already > > > need the preempt notifier for KVM, anyway... > > > > > > > I wouldn't be opposed to that, but how does it solve this problem?  > > If > > as Peter said cond_resched() can be a NOP, then preemption would have > > to > > be from an interrupt, in which case frame pointers aren't reliable. > > > The systems where we are seeing problems do not, as far > as I know, throw softlockup errors, so the kworker > threads that fail to transition to the new KLP version > are sleeping and getting scheduled out at times. Are they sleeping due to an explicit call to cond_resched()? > A KLP transition preempt notifier would help those > kernel threads transition to the new KLP version at > any time they reschedule. ... unless cond_resched() is a no-op due to CONFIG_PREEMPT? > How much it will help is hard to predict, but I should > be able to get results from a fairly large sample size > of systems within a few weeks :) As Peter said, keep in mind that we will need to fix other cases beyond Facebook, i.e., CONFIG_PREEMPT combined with non-x86 arches which don't have ORC so they can't reliably unwind from an IRQ. -- Josh