From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 A23DC2ECD3A for ; Fri, 19 Jun 2026 12:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781870980; cv=none; b=mvexwPAo2SQSFQemi7jsNDqMSdotoLPp4hqkybsjVioE3kpsoh5Q+FWSW44sVW179LGR6tP3YGYnNbFl+PDrXjx+EWzCL5uO/Rz0OU+3NRkKN+zwSqVZbDZPRjF80mKwzOyvrWBsQ8Xzaf2WO4mf1295SEjnvVZWTgyb2ZN1/JY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781870980; c=relaxed/simple; bh=uEC5u4MSNV152j4uKm5LKCFNpyVETvn3Vh+1CHcRLp4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DUU6zdBNc9LAEPqfuKDc2D1w42VU7i/zY1m8pAGtHw0FpHRftuyIxXuj4e5UeH6eM3QEgaJOZEZcuRMChRz8bGxYy3XwyeqXO75s3Hj9L+0EgdVTQWw4vNuaqMgt6gvBEcpVbFef/FaAqI+BzYOuCt+C1ri23/iCqvYaebuVs8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KNry+8kk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KNry+8kk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 268961F00A3E; Fri, 19 Jun 2026 12:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781870979; bh=0GS0A+IFgITksiTouHWoieJdGp3AW5vhPLcHf+koJZg=; h=From:To:Cc:Subject:Date; b=KNry+8kkVktj0ZhaKHcA0HiSe/u4p1ROZqCSKW3Db2MO0nOo4lMnhmpnZEEf0B0Pz o5MgVbi+hItnBSsN6pP/2T5f2orypo6fXjFCi+FgkOQFus0kiLDbtpjCNqsbrG2jr/ Z1kGkDTRkOfYcx1IQx92eBvyJ0MS/tLZwlKjxGVhzWwwI2P4qZbPl6aIjdcw+1AWEo 8p8YJkPygFPvrobz2RDQBdW5JMqPgNSlapePaCf949qSUmX1fWes4RiyVIhJV429E0 8RqQW82CmUKokgdQ7mm6wvjL12TSuRMoaFDFDsu7uGEqd4YbkHs169IpeOiUnuvj6k i533b5F/9noVA== From: "Christophe Leroy (CS GROUP)" To: Shrikanth Hegde , Peter Zijlstra , Michael Ellerman , Nicholas Piggin , Madhavan Srinivasan Cc: "Christophe Leroy (CS GROUP)" , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: Remove dead non-preemption code Date: Fri, 19 Jun 2026 14:08:28 +0200 Message-ID: <2bf10a0afffefb6aca44bf2f864cc17471a80e31.1781870889.git.chleroy@kernel.org> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2071; i=chleroy@kernel.org; h=from:subject:message-id; bh=uEC5u4MSNV152j4uKm5LKCFNpyVETvn3Vh+1CHcRLp4=; b=owGbwMvMwCV2d0KB2p7V54MZT6slMWSZGpYsW+BQdsrRYN3pkJMdraZHrE/Va0QJbGee3VGzl u3xlFMXOkpZGMS4GGTFFFmO/+feNaPrS2r+1F36MHNYmUCGMHBxCsBEvs1mZGid8CR2yf+T62Ui Z2udSs576tb/uvrKNivlM3d2hcy7xdDB8D+rO0T/W++Ba5LMEr4HDesW72D7YBew3bVRRit6kbg 4KwsA X-Developer-Key: i=chleroy@kernel.org; a=openpgp; fpr=10FFE6F8B390DE17ACC2632368A92FEB01B8DD78 Content-Transfer-Encoding: 8bit Since commit 7dadeaa6e851 ("sched: Further restrict the preemption modes"), powerpc always has CONFIG_PREEMPTION because only CONFIG_PREEMPT and CONFIG_PREEMPT_LAZY are possible, even in dynamic preemption mode (see sched_dynamic_mode). As a consequence, need_irq_preemption() is always true and can be removed. And because commit bee25f97ad24 ("powerpc: Enable GENERIC_ENTRY feature") includes linux/irq-entry-common.h which already declares sk_dynamic_irqentry_exit_cond_resched static key, asm/preempt.h becauses useless and can be removed. Signed-off-by: Christophe Leroy (CS GROUP) --- arch/powerpc/include/asm/preempt.h | 16 ---------------- arch/powerpc/lib/vmx-helper.c | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 arch/powerpc/include/asm/preempt.h diff --git a/arch/powerpc/include/asm/preempt.h b/arch/powerpc/include/asm/preempt.h deleted file mode 100644 index 000e2b9681f3..000000000000 --- a/arch/powerpc/include/asm/preempt.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_POWERPC_PREEMPT_H -#define __ASM_POWERPC_PREEMPT_H - -#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 - -#endif /* __ASM_POWERPC_PREEMPT_H */ diff --git a/arch/powerpc/lib/vmx-helper.c b/arch/powerpc/lib/vmx-helper.c index 57e897b60db8..cc9fb72cb4eb 100644 --- a/arch/powerpc/lib/vmx-helper.c +++ b/arch/powerpc/lib/vmx-helper.c @@ -46,7 +46,7 @@ int exit_vmx_usercopy(void) * set and we are preemptible. The hack here is to schedule a * decrementer to fire here and reschedule for us if necessary. */ - if (need_irq_preemption() && need_resched()) + if (need_resched()) set_dec(1); return 0; } -- 2.54.0