From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF94243BDCA for ; Tue, 28 Jul 2026 12:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785242414; cv=none; b=rFbcw2/cRpfCVk8CmjoqakOj2kc90Sdo99kWFKpm6GYwBBhws0bnG+IFmtB4SmJbDi9pdEOHzzvUMO5vVAawiyd5ua14Z6ZfzVAv42uJ6kCwzIRyn3xDcdtpcrN1fU0HOOL+k/YZ6jPM7NhpIdk9LL52RluMNhOqGMnXsrd2B4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785242414; c=relaxed/simple; bh=yLmrifSdu9uBeRu/ZTm5tps7A7KZZniygcl9x67XpLU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UU8D6ttvEXYbU/E5ZGdoLk+qJl6TTd6b3afz6Jzmw2ULRmW2Duy95+PeljAUCaFTFs6aOos4T3te5HSmIlXiUPG5l6yyGjV+OCahPK5C9zPvRYxlLxZrrGCAk1Dme00aLAeNCjL3DNMK/8TlwFjxEWkR3BXTeDvgvy4P8efI200= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=qOgtv3Hy; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="qOgtv3Hy" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 27385175D; Tue, 28 Jul 2026 05:40:08 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 62E793F86F; Tue, 28 Jul 2026 05:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785242412; bh=yLmrifSdu9uBeRu/ZTm5tps7A7KZZniygcl9x67XpLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qOgtv3HyprGwzrGiFrITNgFRCUtCqTBbUAAnRIDVdcvgTINFdLGNJh2TAq5U3246R 1x4gw2e7OwfCMpdHxLw/vvoCv9TPEDO2R2e3Xfec5PBdiYKywgdC3UATaY7yTtLA4+ OMpNwDidADp+JuIux5EzIXymtfKNmtnRHmxMLHK0= From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: ada.coupriediaz@arm.com, ardb@kernel.org, catalin.marinas@arm.com, hca@linux.ibm.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com, maz@kernel.org, peterz@infradead.org, ruanjinjie@huawei.com, vladimir.murzin@arm.com, will@kernel.org, yang@os.amperecomputing.com Subject: [RFC PATCH 13/13] arm64: percpu: Remove _pcp_protect*() wrappers Date: Tue, 28 Jul 2026 13:38:59 +0100 Message-Id: <20260728123859.2911495-14-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260728123859.2911495-1-mark.rutland@arm.com> References: <20260728123859.2911495-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Now that all this_cpu_*() operations are preemptible, there are no users of _pcp_protect() or _pcp_protect_return(). Remove them both, along with the associated comment regarding preemption. Signed-off-by: Mark Rutland Cc: Ada Couprie Diaz Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: Jinjie Ruan Cc: Marc Zyngier Cc: Peter Zijlstra Cc: Vladimir Murzin Cc: Will Deacon Cc: Yang Shi --- arch/arm64/include/asm/percpu.h | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h index 6785d1bc933b9..aa1fd9a09c7cb 100644 --- a/arch/arm64/include/asm/percpu.h +++ b/arch/arm64/include/asm/percpu.h @@ -343,33 +343,6 @@ PERCPU_CMPXCHG_OP(x, , 64) #undef PERCPU_XCHG_OP #undef PERCPU_CMPXCHG_OP -/* - * It would be nice to avoid the conditional call into the scheduler when - * re-enabling preemption for preemptible kernels, but doing that in a way - * which builds inside a module would mean messing directly with the preempt - * count. If you do this, peterz and tglx will hunt you down. - * - * Not to mention it'll break the actual preemption model for missing a - * preemption point when TIF_NEED_RESCHED gets set while preemption is - * disabled. - */ - -#define _pcp_protect(op, pcp, ...) \ -({ \ - preempt_disable_notrace(); \ - op(raw_cpu_ptr(&(pcp)), __VA_ARGS__); \ - preempt_enable_notrace(); \ -}) - -#define _pcp_protect_return(op, pcp, args...) \ -({ \ - typeof(pcp) __retval; \ - preempt_disable_notrace(); \ - __retval = (typeof(pcp))op(raw_cpu_ptr(&(pcp)), ##args); \ - preempt_enable_notrace(); \ - __retval; \ -}) - #define _pcp_wrap(op, pcp, ...) \ ({ \ op(&(pcp), __VA_ARGS__); \ -- 2.30.2