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 BF994C433F5 for ; Thu, 3 Feb 2022 11:53:39 +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=famcxUmYG49uUM9vdYR1581LlkIZ/Iquz5TEYMQM6tw=; b=FQS7vod7XwZw5u s6IQ9itqWEvF4wAFKwbMBPz6EnAwcbtump+VEZpky93vygtxVzbMVGz2jo1R2Xs1EJ9wApyNs1ueU Yi7S32CWrZenEt7grPCLf9IN5VxDQ56sLPBdR3ZZHYzGELIkTyvPF4e3rtRlMySS61xJa6JkbNNCe jR58ZiU4dkgpOmu1TE9R3yP0g7o+DzPfgMmUrTUUHal5iq8EER8aYSaVQWdmLzNRri5Z0PLip9Stp Jo/SoB1W5YGoXhVsFux/B40wuG7p/9OHdRESQTAeio5rWsqiNgHA3JmyGKLRHJ089oj79liL0nRdl AGc2QVj6PCFBUaYlXXBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFaf3-0013Il-EV; Thu, 03 Feb 2022 11:52:25 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFaf0-0013I0-Gv for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 11:52:23 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 78ACA6156B; Thu, 3 Feb 2022 11:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE885C340E4; Thu, 3 Feb 2022 11:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643889141; bh=xqeQ8J1eLBewrk6Mue9ZGQqdEUirZcc5PbW3BH9s4bo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nu+hc8ZuO5e7BtcDA8dV1LZF0o05VaHWN+CA6ohXHRaW9yQhyz/Wt3yum+loIyoH4 XAv5uEpNj21zuZ7Vu9Zpnlk/wEdlqscFAs2qd+PDbnVX5hyO4XW/v6G3fxhkhPV/LG 0MtDKllieKPzISPjzuuY+G51LTR572NY3AFp6uTGGa4RhYoZKzhb7FjxQTnhxFhI8r TEGKrmdCE30mrgXfbMEL8LDWzSZ666zAuLKnESGr4los6JLNsUL2yXd7bnbMWmHO2n k1TwBskuQnSlkD2D2IqcEVnEAHLrkUSf+fusQ7z4wbwBxyQ50CoPPLZsyDEZAjZuEf gnRpkdPHh9wCw== Date: Thu, 3 Feb 2022 12:52:18 +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: <20220203115218.GB471778@lothringen> References: <20211109172408.49641-1-mark.rutland@arm.com> <20211109172408.49641-3-mark.rutland@arm.com> <20211210151343.GA755274@lothringen> <20220202160144.GA458420@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-20220203_035222_666614_E14B5E41 X-CRM114-Status: GOOD ( 26.49 ) 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 06:08:27PM +0000, Mark Rutland wrote: > On Wed, Feb 02, 2022 at 05:01:44PM +0100, Frederic Weisbecker wrote: > > On Wed, Feb 02, 2022 at 03:13:57PM +0000, Mark Rutland wrote: > > > > > +#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. > > Looking at this some more, I'm probably going to need to do token-pasting at > some level no matter what we do, so how big of a concern is this? Searching > for 'foo_function' should also find 'foo_function_dynamic_enabled' and > 'foo_function_dynamic_disabled', and searching for either of those will find > their original definition. > > If others aren't concerned, could we just live with that for now? Sure, I don't have a better idea right now. I'll try to think of something after the next iteration. > > 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.... > > Having had a play with this, since you need to generate a wrapper for the > static_key case, you either need to match the prototype or have a generic > macro (and you likely end up back in token-pasting hell again anyhow). > > So as above, how much does this matter for now? > > > 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) > > In this series I just define preempt_dynamic_enable() dependent on > CONFIG_STATIC_CALL or CONFIG_STATIC_KEY, which is functionally equivalent. You're right. It's just that instead of: #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) #ifndef preempt_schedule_notrace_dynamic_enabled #define preempt_schedule_notrace_dynamic_enabled preempt_schedule_notrace #define preempt_schedule_notrace_dynamic_disabled NULL #endif #if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) #define preempt_dynamic_enable(f) static_call_update(f, f##_dynamic_enabled) #define preempt_dynamic_disable(f) static_call_update(f, #f##_dynamic_disabled) You have: DECLARE_STATIC_CALL_TOGGLE(preempt_schedule_notrace, __preempt_schedule_notrace_func); #define preempt_dynamic_enable(f) static_call_enable(f) #define preempt_dynamic_disable(f) static_call_disable(f) Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel