Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp973663pxp; Wed, 16 Mar 2022 23:07:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEn9n7+2msi+G41waPf46cizkuKCMB1uegKsWAfEn1BxGl3ZznUgsXDxmw64QHS0LazHzi X-Received: by 2002:a62:1d48:0:b0:4f6:b805:4bad with SMTP id d69-20020a621d48000000b004f6b8054badmr2842723pfd.67.1647497278847; Wed, 16 Mar 2022 23:07:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497278; cv=none; d=google.com; s=arc-20160816; b=DTB7g1cjFqyqXDP4aqB0FF1YcXG4/eVenQADmdlrx8O6i8pgnXZstIuZiN9qBlTUz6 4YUd7MAClfJk3tdzl19hkX+hBzF+TqWGkSCUpptPCkVM4Z+w8/k4oM8QTxBD0V9Z/XKJ 5kSwUYG+x+tIxIe0EZPhiKGWU13jE50I0rOy1hmNw8Tg0ohCZzyaIeVjDc4iEjtomoLb /ERpbLgiTcnIaaaQoJ08u1tkQ33W6wBIQ0uCeqrhFVbcmHNJZjjzxTnn5pINyZua0aHx 0sDiZ+kWyDReriMEKKh2QJFL5Oc6EllURElrZ7mpbouU36yMnUQEExwKsgNg3lYoY9qJ GN1A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RnuCGTeu7RaGp2VSgeeeyUwWvH6n78SAnnKRoihdHt8=; b=HXhyjXEbpxvas+g830cAggXkGCDS+HxOf6BdPM00oLSnZreecezwhpBgS6oL03usJA klJYK5X1LhuYGA6F6c810idDUwfUSrxrPRWU5bPLSQ0teMPUNcuR6OuB4qk38KdeCoMi wSZa+8EMsX+MUtn88hBtl+tvBUMwSPRTdS8wfX1VDO8KtZlOqGcgDpPJ4wJ2mZWWB1SO WrCEAonsSoG3eEc15CWq1aj1tey+BfCFA0bAARn81OBfYZ8HFd8hoxVsmzTG3fqtIPxp Z8RPtSiNUlShVwN6ZVZsOvCJ8KCm+Ne8/8uBdT3aWxm/t/nfgdgSkVVCnsbfyDSLojno dEWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a7FzeXaD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l4-20020a170902f68400b00151c6aee229si4217351plg.227.2022.03.16.23.07.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a7FzeXaD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 47BD2E389D; Wed, 16 Mar 2022 22:17:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242893AbiCNWvZ (ORCPT + 99 others); Mon, 14 Mar 2022 18:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiCNWvX (ORCPT ); Mon, 14 Mar 2022 18:51:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38DCF12AEA for ; Mon, 14 Mar 2022 15:50:12 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3302B6145D for ; Mon, 14 Mar 2022 22:50:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A39BC340E9; Mon, 14 Mar 2022 22:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647298211; bh=yU6R9YbJUvwfWtUyD7sqbv7BgTnIuuJOKpA58IceBKk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a7FzeXaDkLXX7FkVlUTsQXve+HwRAfWZfhZaliDi+/igBX5ygYOQe1Md9z7wSNzK0 yqkbsDBWouFyeywabPn9nDKhxPhQLyy+5Ed6pQfSXH/zD9DuY3QYVr4J7nDFCmeB01 cjPUtR1dP5mp4NG4XXQdcgUIU/8GeDJrc6OodpmXlHxvPj5ipb1Oes3JkqbPMIHDX4 u20fvv+n7+G5m/V9up72sEb/RpA5BLpP4Augcv4HXALLeDsdIL9Rht8xp0THLpqhKH o1/VHnreG8cPQg+7V5l3DuSeG1/ks6esQSR6zO2GhCN7R01DtT4VcGGBSe1AJfwjnp wnnODqal+zlCw== Date: Mon, 14 Mar 2022 23:50:08 +0100 From: Frederic Weisbecker To: Marco Elver Cc: paulmck@kernel.org, LKML , Valentin Schneider , Peter Zijlstra , Neeraj Upadhyay , Boqun Feng , Uladzislau Rezki , Joel Fernandes Subject: Re: [PATCH 2/3] preempt/dynamic: Introduce preempt mode accessors Message-ID: <20220314225008.GB274290@lothringen> References: <20220314133738.269522-1-frederic@kernel.org> <20220314133738.269522-3-frederic@kernel.org> <20220314200641.GV4285@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, Mar 14, 2022 at 09:34:26PM +0100, Marco Elver wrote: > On Mon, 14 Mar 2022 at 21:06, Paul E. McKenney wrote: > > > > On Mon, Mar 14, 2022 at 03:44:39PM +0100, Marco Elver wrote: > > > On Mon, 14 Mar 2022 at 14:37, Frederic Weisbecker wrote: > > > > > > > > From: Valentin Schneider > > > > > > > > CONFIG_PREEMPT{_NONE, _VOLUNTARY} designate either: > > > > o The build-time preemption model when !PREEMPT_DYNAMIC > > > > o The default boot-time preemption model when PREEMPT_DYNAMIC > > > > > > > > IOW, using those on PREEMPT_DYNAMIC kernels is meaningless - the actual > > > > model could have been set to something else by the "preempt=foo" cmdline > > > > parameter. > > > > > > > > Introduce a set of helpers to determine the actual preemption mode used by > > > > the live kernel. > > > > > > > > Suggested-by: Marco Elver > > > > Signed-off-by: Valentin Schneider > > > > Signed-off-by: Frederic Weisbecker > > > > Cc: Uladzislau Rezki > > > > Cc: Joel Fernandes > > > > Cc: Boqun Feng > > > > Cc: Peter Zijlstra > > > > Cc: Neeraj Upadhyay > > > > --- > > > > include/linux/sched.h | 16 ++++++++++++++++ > > > > kernel/sched/core.c | 11 +++++++++++ > > > > 2 files changed, 27 insertions(+) > > > > > > > > diff --git a/include/linux/sched.h b/include/linux/sched.h > > > > index 508b91d57470..d348e886e4d0 100644 > > > > --- a/include/linux/sched.h > > > > +++ b/include/linux/sched.h > > > > @@ -2096,6 +2096,22 @@ static inline void cond_resched_rcu(void) > > > > #endif > > > > } > > > > > > > > +#ifdef CONFIG_PREEMPT_DYNAMIC > > > > + > > > > +extern bool preempt_mode_none(void); > > > > +extern bool preempt_mode_voluntary(void); > > > > +extern bool preempt_mode_full(void); > > > > + > > > > +#else > > > > + > > > > +#define preempt_mode_none() IS_ENABLED(CONFIG_PREEMPT_NONE) > > > > +#define preempt_mode_voluntary() IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY) > > > > +#define preempt_mode_full() IS_ENABLED(CONFIG_PREEMPT) > > > > + > > > > > > Shame this was somehow forgotten. > > > There was a v3 of this patch that fixed a bunch of things (e.g. making > > > these proper functions so all builds error if accidentally used in > > > #if). > > > > > > https://lore.kernel.org/lkml/20211112185203.280040-3-valentin.schneider@arm.com/ > > > > > > Is it also possible to take all the rest of that series (all 4 > > > patches) from Valentin? > > > > Me, I am assuming that #2/3 is an experimental test so that I am able > > to easily whack this series over the head with rcutorture. ;-) > > I might be out of the loop here. All I can add is that any issues that > are a consequence of the preempt mode accessors are only testable if > the preemption model is actually changed at runtime and AFAIK > rcutorture doesn't do that. But as noted, this patch wasn't the latest > version and there were issues with it fixed by Valentin's latest v3 > (from November, but had never been picked up anywhere). Thanks for the reminder, the patchset indeed got forgotten somewhow. If necessary I'll resend it.