From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout02.his.huawei.com (canpmsgout02.his.huawei.com [113.46.200.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC2DA399354 for ; Fri, 7 Aug 2026 01:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.217 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786066550; cv=none; b=ru/2LjJj4zUY8lYG2W34TB72r12mg8Ajj6RiBszYM8kKJLkSvvyL4p/5gGmhgEI12X4YlHDSz66pqQ4sEXNfcQYwxbzmUUHAHvGhSsTF4A4CWTBYS2f63sgkiAdyZluFqTXeqZttEuzEgKZcTB3Q9DNV0Xlo6AzmwfAZTGNtC9w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786066550; c=relaxed/simple; bh=4jfEhn56ve+c6GuxoAkx8lnRgpYuQPa5ofiYgE9W/Lk=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=dqGdOv1/ekUA3WwKFaMsMKlGe8fHUDOTC7bFrsjL8kEY1rdGg/sTpe2F24/sW25qM0rDhFOxbj27wHQh5aXUOWhkAZ/Sw2RLLE0tlcr7NA4ewGMULoDrB33f52THbUYOfcLMm1DJpqrCXvPFCdKZEUbzd2icT2Nb81I6ha7gtHw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=qBKB1mI9; arc=none smtp.client-ip=113.46.200.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="qBKB1mI9" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=YykavihoFdhbuQ05p87QefkuJ8UTyC3RIykpCfVqRZY=; b=qBKB1mI9BYBPrLINW6B9hvx4Fdb26Fz6OiOMYCjmLk+cAgKhxWf+l2zgy9QjTEQA5mnh5QTLt 1TS9JK0XRQ/2Zyi4uYCBSb+HmgY6wYUb9FmeZtA9e13QbHMGhKVUdSa7a2IltmprZ0JgbV6Eb0U INrTjZhYvwglVA1rltg48Z8= Received: from mail.maildlp.com (unknown [172.19.163.104]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4hGRKS5HJBzcb0T; Fri, 7 Aug 2026 09:25:16 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 333AA4057F; Fri, 7 Aug 2026 09:35:14 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 7 Aug 2026 09:35:13 +0800 Message-ID: <62a5fb7c-ac55-4b28-aaae-09d55da36545@huawei.com> Date: Fri, 7 Aug 2026 09:35:12 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/6] sched: dynamic: Simplify irqentry_exit_cond_resched() To: Mark Rutland , CC: , , , , , , , , , References: <20260803191731.3244294-1-mark.rutland@arm.com> <20260803191731.3244294-5-mark.rutland@arm.com> From: Jinjie Ruan In-Reply-To: <20260803191731.3244294-5-mark.rutland@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To dggpemf500011.china.huawei.com (7.185.36.131) 在 2026/8/4 3:17, Mark Rutland 写道: > PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models. > In either model, irqentry_exit_cond_resched() is always called and never > disabled. Hi Mark, Is it necessary to mention that all architectures supporting generic irq entry support PREEMPT_DYNAMIC? > > Remove the unnecessary code for this when PREEMPT_DYNAMIC is selected. > > Signed-off-by: Mark Rutland > Reviewed-by: Shrikanth Hegde > Cc: Frederic Weisbecker > Cc: Ingo Molnar > Cc: John Stultz > Cc: Juri Lelli > Cc: Peter Zijlstra > Cc: Shrikanth Hegde > Cc: Thomas Gleixner > Cc: Valentin Schneider > Cc: Vincent Guittot > --- > include/linux/irq-entry-common.h | 17 +---------------- > kernel/entry/common.c | 17 ++--------------- > kernel/sched/core.c | 7 ------- > 3 files changed, 3 insertions(+), 38 deletions(-) > > diff --git a/include/linux/irq-entry-common.h b/include/linux/irq-entry-common.h > index 1fabf0f5ea8e7..de7e10de91d04 100644 > --- a/include/linux/irq-entry-common.h > +++ b/include/linux/irq-entry-common.h > @@ -346,22 +346,7 @@ typedef struct irqentry_state { > * > * Conditional reschedule with additional sanity checks. > */ > -void raw_irqentry_exit_cond_resched(void); > - > -#ifdef CONFIG_PREEMPT_DYNAMIC > -#if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > -#define irqentry_exit_cond_resched_dynamic_enabled raw_irqentry_exit_cond_resched > -#define irqentry_exit_cond_resched_dynamic_disabled NULL > -DECLARE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); > -#define irqentry_exit_cond_resched() static_call(irqentry_exit_cond_resched)() > -#elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) > -DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); > -void dynamic_irqentry_exit_cond_resched(void); > -#define irqentry_exit_cond_resched() dynamic_irqentry_exit_cond_resched() > -#endif > -#else /* CONFIG_PREEMPT_DYNAMIC */ > -#define irqentry_exit_cond_resched() raw_irqentry_exit_cond_resched() > -#endif /* CONFIG_PREEMPT_DYNAMIC */ > +void irqentry_exit_cond_resched(void); > > /** > * irqentry_enter_from_kernel_mode - Establish state before invoking the irq handler > diff --git a/kernel/entry/common.c b/kernel/entry/common.c > index e3d381fd3d251..e234b04373fea 100644 > --- a/kernel/entry/common.c > +++ b/kernel/entry/common.c > @@ -123,7 +123,7 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs) > /** > * arch_irqentry_exit_need_resched - Architecture specific need resched function > * > - * Invoked from raw_irqentry_exit_cond_resched() to check if resched is needed. > + * Invoked from irqentry_exit_cond_resched() to check if resched is needed. > * Defaults return true. > * > * The main purpose is to permit arch to avoid preemption of a task from an IRQ. > @@ -134,7 +134,7 @@ static inline bool arch_irqentry_exit_need_resched(void); > static inline bool arch_irqentry_exit_need_resched(void) { return true; } > #endif > > -void raw_irqentry_exit_cond_resched(void) > +void irqentry_exit_cond_resched(void) > { > if (!preempt_count()) { > /* Sanity check RCU and thread stack */ > @@ -145,19 +145,6 @@ void raw_irqentry_exit_cond_resched(void) > preempt_schedule_irq(); > } > } Otherwise, LGTM Reviewed-by: Jinjie Ruan > -#ifdef CONFIG_PREEMPT_DYNAMIC > -#if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) > -DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resched); > -#elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) > -DEFINE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); > -void dynamic_irqentry_exit_cond_resched(void) > -{ > - if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) > - return; > - raw_irqentry_exit_cond_resched(); > -} > -#endif > -#endif > > noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) > { > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index f88b9ef70a0dd..4f754f4a472f8 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -7788,9 +7788,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); > # endif > > /* > - * SC:irqentry_exit_cond_resched > - * > - * > * NONE: > * (unselectable) > * > @@ -7798,11 +7795,9 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); > * (unselectable) > * > * FULL: > - * irqentry_exit_cond_resched <- irqentry_exit_cond_resched > * dynamic_preempt_lazy <- false > * > * LAZY: > - * irqentry_exit_cond_resched <- irqentry_exit_cond_resched > * dynamic_preempt_lazy <- true > */ > > @@ -7846,14 +7841,12 @@ static void __sched_dynamic_update(int mode) > { > switch (mode) { > case preempt_dynamic_full: > - preempt_dynamic_enable(irqentry_exit_cond_resched); > preempt_dynamic_key_disable(preempt_lazy); > if (mode != preempt_dynamic_mode) > pr_info("Dynamic Preempt: full\n"); > break; > > case preempt_dynamic_lazy: > - preempt_dynamic_enable(irqentry_exit_cond_resched); > preempt_dynamic_key_enable(preempt_lazy); > if (mode != preempt_dynamic_mode) > pr_info("Dynamic Preempt: lazy\n");