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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 416FBC433EF for ; Wed, 2 Feb 2022 16:03:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7LTkeosCSVHUQK7knEUxFUT6akJcSZETYFRqWQzO09k=; b=0Ufmjg2Vj+ttTO NUFlpzIJbTxTE4DOpty/Khof52Z63Nx/DGmLmBW7RHtGd+/wY1U/HxBki6yiaVbANcqVUEt5plWye Oe8Z4fm4tcvS1NtZPEQQKBnJL3jMR9nBIIHSotBAQWsKE0BWjBHoCwKaVPATDYwQ1q8NmjwIzrLGh ts3KWunLG30OQXwDiCBORf/cf6E2FTEribUlUDLebg+z/lLaKP5YFaDsZAIMyoXPhW1wzcguVyXh2 HkUhdJSEPJVQIXFD9Fpg0oWYK+lxqpGKixhG8YP1IVDtdCg4deVh9VYX/KE8zNMNH5a9l9GffcdCE erDFocL8/B412OtFnpaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFI4z-00G8G7-R8; Wed, 02 Feb 2022 16:01:58 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFI4r-00G8Di-BM for linux-arm-kernel@lists.infradead.org; Wed, 02 Feb 2022 16:01:51 +0000 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 09861B831A5; Wed, 2 Feb 2022 16:01:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49A0CC004E1; Wed, 2 Feb 2022 16:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643817706; bh=aIj6kLUJOPm3pipxmkj0OFAkJmTcxZCTVYlvSurhL5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GwC9uVJ+WduPa3svoc0sx+2QgpRF9lOvwJQk7/qmaCwxRA6Q/9a2WskC8zgBYOJaB 4zRGYYjOr19sp+fqkzTv6QunPQ+lp9wyUsV+u1wxOR89rpP0J/UVUNwTFMnqynGfmK w6eBNqREWuoeLtcTMeonkxkblrOD5hhuA9h0XPlTwvCL5/+Bo+do5oVDcWZ12HZkrp LtB+T9qMdkwpl52CI5rvDNDN47LS4+m2whLOPbLMSa7/pAvO9y25Q8KWYave4mBwlN O8zG0R6JrnsHlnc9dmzecSUuLsi79snlpvEku+U5adl54D1J7P+dlnd1Gd13+4ptV2 Pz/ZKgIEEZVig== Date: Wed, 2 Feb 2022 17:01:44 +0100 From: Frederic Weisbecker To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, ardb@kernel.org, catalin.marinas@arm.com, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, will@kernel.org Subject: Re: [PATCH 2/6] sched/preempt: refactor sched_dynamic_update() Message-ID: <20220202160144.GA458420@lothringen> References: <20211109172408.49641-1-mark.rutland@arm.com> <20211109172408.49641-3-mark.rutland@arm.com> <20211210151343.GA755274@lothringen> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220202_080149_732562_D8D558C9 X-CRM114-Status: GOOD ( 27.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 02, 2022 at 03:13:57PM +0000, Mark Rutland wrote: > Hi, > > I'm looking at what I need to do to rebase/repost this atop v5.17-rc2, and I > realised I need your S-o-B to take your suggestion below. > > On Fri, Dec 10, 2021 at 04:13:43PM +0100, Frederic Weisbecker wrote: > > On Tue, Nov 09, 2021 at 05:24:04PM +0000, Mark Rutland wrote: > > > Currently sched_dynamic_update needs to open-code the enabled/disabled > > > function names for each preemption model it supoprts, when in practice > > > this is a boolean enabled/disabled state for each function. > > > > > > Make this clearer and avoid repetition by defining the enabled/disabled > > > states at the function definition, and using helper macros to peform the > > > static_call_update(). Where x86 currently overrides the enabled > > > function, it is made to provide both the enabled and disabled states for > > > consistency, with defaults provided by the core code otherwise. > > > > -#define __preempt_schedule_notrace_func preempt_schedule_notrace_thunk > > > +#define preempt_schedule_notrace_dynamic_enabled preempt_schedule_notrace_thunk > > > +#define preempt_schedule_notrace_dynamic_disabled NULL > > > > I'm worried about un-greppable macro definitions like this. > I assume you mean that it's hard to go from: > > preempt_dynamic_enable(preempt_schedule_notrace); > > ... to this, because the `_dynamic_enabled` or `_dynamic_disabled` part gets > token-pasted on? Right. > > The above will show up in a grep for `preempt_schedule_notrace`, but I agree > it's not necessarily ideal, especially if grepping for an exact match. > > > Also this enable/disable switch look like a common pattern on static call so > > how about moving that logic to static call itself? As in below (only > > build-tested): > > Sure; if others also prefer that I'm more than happy to build atop. > > Can I have your Signed-off-by for that, or can you post that as its own patch? Sure, here is a better split and tested version here: git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git static_call/toggle I was hoping to make a default backend based on static keys to implement these toggeable static calls, but I had some issues on the way, although I can't remember exactly which. So eventually I don't know if this stuff will be useful for you.... Well, I guess this can still ease a wrapper like: preempt_dynamic_enable(sym) ---> CONFIG_STATIC_CALL=y? -----> static_call_enable(sym) else ---> CONFIG_STATIC_KEY=y? -----> static_key_enable(sym) Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel