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 60418C433F5 for ; Wed, 2 Feb 2022 23:23:22 +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=1UoqcM3+yWRNqkIsBBLvful0pKWVgwa7xOBB0GQd/wQ=; b=bXg2axbsrrn67d aRScuJ2ybqpBCpQFjV7qwJRbtE3ggXTckGy217w0ORwegAuaAX+LtEjNfqqlVpSxm9STiyPGp7H8d YR/SH4qoGNBdepZj+C/HcqJz7ypfEnCpRXoIN+RZ32rCU5HWhnLXOvBOpOi2R0y29dmMh7bMh+sCq NEQ/ub677W0NDUdPuLbDFZMMngk6zx8DJRF57KIIRglcmG2xDPII0WVdnIDqS7qUAYbaCclSZhHnB pvSEK73MaDskiML3Z0HST/JcIk4MKc+4SX5HAeTxFD74v1efjphQALTKr/T2WRwH9dvehfzC3MCeo i83zf6OrZGQo+d9VS7SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFOwk-00H43c-Ly; Wed, 02 Feb 2022 23:21:54 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFOwh-00H42o-0L for linux-arm-kernel@lists.infradead.org; Wed, 02 Feb 2022 23:21:52 +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 66A11B832AC; Wed, 2 Feb 2022 23:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 902E1C004E1; Wed, 2 Feb 2022 23:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643844108; bh=D+NrSNJGEcrj8++Y6EQPnZIWyTEi499j/U19xCKvlCI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vLlnUtY0c6YjdaUBGbmpDEBFB7VLcnB+9wwflR9IfNN7mVXnyijAYcyXLU1fgyq2A WJ4dLtVf7Eq/rlL1p1Ic5k0K3qR2VbUm8VHpFhCrGu+BFvsH0Tt+5T6YJ57280neF8 ZQyMdeIVOqy82yA7si8017Hcv7xitiXxXjZZcxHLAQDEj2eLkNT2TZYbpLM9CWBxDl bwWRmdKjBmDZi1DzpUrVqJZvw33P7jOvd4QktPM3yQYrCVk8coteg6mZ7iVfl9KpcQ FPxEF8yXOfp63xWhMOpuCW1da4+Q2hD4alXSpaRtHqj5mYfSQKQo6lQMgJHxpUDnxX wQh6ZSHQ31a4A== Date: Thu, 3 Feb 2022 00:21:45 +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 5/6] sched/preempt: add PREEMPT_DYNAMIC using static keys Message-ID: <20220202232145.GA461279@lothringen> References: <20211109172408.49641-1-mark.rutland@arm.com> <20211109172408.49641-6-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211109172408.49641-6-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220202_152151_263400_654E7977 X-CRM114-Status: GOOD ( 15.14 ) 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 Tue, Nov 09, 2021 at 05:24:07PM +0000, Mark Rutland wrote: > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index e5359b09de1d..8a94ccfc7dc8 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -93,7 +93,7 @@ struct user; > extern int __cond_resched(void); > # define might_resched() __cond_resched() > > -#elif defined(CONFIG_PREEMPT_DYNAMIC) > +#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > > extern int __cond_resched(void); > > @@ -104,6 +104,11 @@ static __always_inline void might_resched(void) > static_call_mod(might_resched)(); > } > > +#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) > + > +extern int dynamic_might_resched(void); > +# define might_resched() dynamic_might_resched() > + > #else > > # define might_resched() do { } while (0) > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 78c351e35fec..7710b6593c72 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -2008,7 +2008,7 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) > #if !defined(CONFIG_PREEMPTION) || defined(CONFIG_PREEMPT_DYNAMIC) > extern int __cond_resched(void); > > -#ifdef CONFIG_PREEMPT_DYNAMIC > +#if defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > > DECLARE_STATIC_CALL(cond_resched, __cond_resched); > > @@ -2017,6 +2017,14 @@ static __always_inline int _cond_resched(void) > return static_call_mod(cond_resched)(); > } > > +#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) > +extern int dynamic_cond_resched(void); > + > +static __always_inline int _cond_resched(void) > +{ > + return dynamic_cond_resched(); So in the end this is creating an indirect call for every preemption entrypoint. It seems to me that this loses the whole point of using static keys. Is there something that prevents from using inlines or macros? Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel