From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 D0F0C25FA05 for ; Mon, 6 Jul 2026 04:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783312974; cv=none; b=aJ4zRdfGQF4UC0SKo49UgZKbQjXcz001YHm1PP4dRTyJOxBq5xULCj1SEQ61juvYy1HcuDx7hBdk0YnrND1njOosOfEojCXuTs9AolLPkxMhASanvZ/VaBXdKjOOuGyvVHO9nopcn+RXv3PbiPJvuTVo3dR9dfkyNxtVgTBEHFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783312974; c=relaxed/simple; bh=782jnHb7KJv1PG9IXGP2nMFMBDhWLy5tFeKK6L68fM0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S8FOMVj3zS3PFqohGnR0VBVc1vxSuB/HkS/FsDMoFcchsvDmVOpytTJg0/RXUpaE2e6BfI7a/L+xS+TsQfPbeZX0pY59La5EMYns+uWRPmsopxkCsc44tv6g5hIVhbul1M0Xx+LygbNqUcQ9SMcO+fSZ10OxvpIe0RUJvJYYuSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=fSdOx4bT; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="fSdOx4bT" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 665MII4M2427664; Mon, 6 Jul 2026 04:42:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=mcMwWS 64TBwa+yd9NLbt2ic9PVR7VoqMleiD2ytL5/k=; b=fSdOx4bT8bgjwI+MPHsKXi 2FddWUlhAiya8Ju8HgkoNkYP6O5RBqENziP/dq2dx3k7jnF/wdr2MIzeP+Pxou5b rbsloZ0dt9FJ0SybRWKxXjYz/nyAK7re4nkDc9bT+GbrCf1vTE+U0NlHjHN3+gQs 8zT3LIETRlgE0FoCnhWcXZAj4MJsUxBV28tdet6X4qQlY75405+IVgxpt5MKEHSs N14/WZ++S+poG0h8ewA0gmA4ejFqEkPW79ykteObaV1E2t1rk+LlVgafTUAj4/dM JIzhbumI3m7K2KIpAsWiBA+I1StEwXVsix1tRa6FPf1GZv/LeSQVhbEbBHs9WF+Q == Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4f6suqfkbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jul 2026 04:42:35 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 6664YZvt004615; Mon, 6 Jul 2026 04:42:34 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4f7eqfuugy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jul 2026 04:42:34 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6664gW9k27263266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Jul 2026 04:42:32 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AD72820040; Mon, 6 Jul 2026 04:42:32 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 166DC20043; Mon, 6 Jul 2026 04:42:30 +0000 (GMT) Received: from [9.123.5.233] (unknown [9.123.5.233]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Jul 2026 04:42:29 +0000 (GMT) Message-ID: <4905f97c-9154-4794-b337-808f6eec2949@linux.ibm.com> Date: Mon, 6 Jul 2026 10:12:29 +0530 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 4/5] sched: dynamic: Simplify irqentry_exit_cond_resched() To: Mark Rutland , linux-kernel@vger.kernel.org, "Christophe Leroy (CS GROUP)" Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com References: <20260703133358.698078-1-mark.rutland@arm.com> <20260703133358.698078-5-mark.rutland@arm.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <20260703133358.698078-5-mark.rutland@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA2MDAzOSBTYWx0ZWRfX0G0qTO/HIZZL S6Srf41Qub7AnNexFcW2GmuTBgXNLql8LUtQoW4gFsFDOdKDNx56gc/o2XZ5solALYOVohKAQ+W 7mwj4aWGAp1+Newu61MFnJ4MPUMXtf4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA2MDAzOSBTYWx0ZWRfX0lzF222QDqVF 72zlDWaezZHpDHBBGmR87DyA9ko9SPZtjuCSDbkZhDfA7TsxQEq7zn3+DL9vWsM4BpJc92ugSU2 elMzwDg9TPtNDSH+3WTCJCXTFL/TwDCA3N7hmqNjI/yyjmu6lB70NQJ4JsjNKCvQ4VDCkYOW574 Q0Wl+pI8JAKBG7ZPdFnSoqvKjJRrktAsAkeAP3ij6hVM7ni7hLFUUcZ/mXSMA+ajo4wNTlqWJsK e9cWvxIgGMZ/xvVxVWm60oIsMdAzFKggja9CqmJGO2jMseVzeTYfZY71O4GTox8gqim2A6LRuFN kOhKETGRVA3S29i46D0P/aKA4O/zGcPOO1pkBRymT8WP+FSjeQ9rIwrcueeQM2b9FVyIfbZTEuG qIBrdcpR9pHGpP5aoLJYn2rRry8QfJoI3bYQG/h5ON1M6LrWDu+Zjg6lMkIDaIcMwLQ0BdsP5qi 96/GHdZiQgUroRYAUfw== X-Proofpoint-GUID: SL_1KuGaQHmESLygGGR6nR7qG9783d-e X-Authority-Analysis: v=2.4 cv=Oot/DS/t c=1 sm=1 tr=0 ts=6a4b323c cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VwQbUJbxAAAA:8 a=7CQSdrXTAAAA:8 a=20KFwNOVAAAA:8 a=1XWaLZrsAAAA:8 a=JfrnYn6hAAAA:8 a=KKAkSRfTAAAA:8 a=VnNF1IyMAAAA:8 a=jWlr119AsMVAax-K24wA:9 a=QEXdDO2ut3YA:10 a=a-qgeE7W1pNrGK8U0ZQC:22 a=1CNFftbPRP8L7MoqJWF3:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: y910rPzZLb09_Paci2WQBkEKCQzchcqB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-07-05_02,2026-07-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 phishscore=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607060039 +cc Christophe. On 7/3/26 7:03 PM, Mark Rutland wrote: > 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. > > Remove the unnecessary code for this when PREEMPT_DYNAMIC is selected. > > Signed-off-by: Mark Rutland > Cc: Frederic Weisbecker > Cc: Ingo Molnar > Cc: John Stultz > Cc: Juri Lelli > Cc: Peter Zijlstra > Cc: Thomas Gleixner > Cc: Valentin Schneider > Cc: Vincent Guittot > --- > arch/powerpc/include/asm/preempt.h | 7 ------- > include/linux/irq-entry-common.h | 17 +---------------- > kernel/entry/common.c | 17 ++--------------- > kernel/sched/core.c | 7 ------- > 4 files changed, 3 insertions(+), 45 deletions(-) > > diff --git a/arch/powerpc/include/asm/preempt.h b/arch/powerpc/include/asm/preempt.h > index 000e2b9681f30..79fc1f9df88d9 100644 > --- a/arch/powerpc/include/asm/preempt.h > +++ b/arch/powerpc/include/asm/preempt.h > @@ -4,13 +4,6 @@ > > #include > > -#if defined(CONFIG_PREEMPT_DYNAMIC) > -#include > -DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); > -#define need_irq_preemption() \ > - (static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) > -#else > #define need_irq_preemption() (IS_ENABLED(CONFIG_PREEMPTION)) > -#endif > JFYI, Christophe had sent this patch, I am sure you guys will sort out the conflicts. (I don't see it merged yet, but likely might) https://lore.kernel.org/all/2bf10a0afffefb6aca44bf2f864cc17471a80e31.1781870889.git.chleroy@kernel.org/ > #endif /* __ASM_POWERPC_PREEMPT_H */ > 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(); > } > } > -#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"); Change per se, looks good to me. Reviewed-by: Shrikanth Hegde