From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2B2F32309AA for ; Fri, 20 Feb 2026 06:39:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771569566; cv=none; b=eMsS3H1h3YtqopTM4mysw83YJu2HqWVQ0X/pM3D6bwm+GzGwS3yqi02pQz/rARhSrMK519Mx0fsfQ9t24EPZkbGScLza/4CN3L9G4MKfOrzcZX/jNN/Z0g/bjKf00oBXfU2VbCN9ZtkJScFEXwWFgTrhTRca2mdsPGWzOeDsUnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771569566; c=relaxed/simple; bh=K03+flrCCAh9UJxfPcPWOWXMwX3CXYJoX3R9jdwQGFw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UThbgcsoCVrNDiPxl0KX4XjsU4zRZx6C8QB9APZ5TJTEqvuwNgObyE6PcSO4koqcCskFG0qKQLcVtrvtbsaqAGfXEQqklN2jOKN0ZzywX8zS8JYK3gSbI4Hs7Pu1QrPDNIzxRDNRR20U+9Bm0xdG6A9qApP/s3IdmRVnBEDU35M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qcs0dJCf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qcs0dJCf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FAD4C116D0; Fri, 20 Feb 2026 06:39:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771569565; bh=K03+flrCCAh9UJxfPcPWOWXMwX3CXYJoX3R9jdwQGFw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qcs0dJCf/unZIOC7XlsbZbpv/C3tIqkn4RXaO2yct+95urWJ3BZpYnTjBV7E7LPvb /oiLU02RTjq2nXKnfZcRsXEE8L2v9ByxldwTPXWHYu4XwlShjAvnpZDiEdG9eGgwNu ekibDgwO8HH27G+w09+tWvmgeweaU4eTSHdlGE72nLsP2xIOiD29cze2T/Z1IhIU6d dtva5h9AzPheTIcVbftt63L/q4DQJYT9tNNFTeIMjztulncLuySUkyiX3agryZimoj UPO9uKXSzcD6A3RDODXBUHmJ6GgMeXEVvssmwJ1SkuD1LTIIw4WZikNP7yP9/Rrpjp LWMrvN41V+UWw== Date: Fri, 20 Feb 2026 14:20:54 +0800 From: Jisheng Zhang To: Shakeel Butt Cc: Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] arm64: remove HAVE_CMPXCHG_LOCAL Message-ID: References: <20260215033944.16374-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Wed, Feb 18, 2026 at 02:07:57PM -0800, Shakeel Butt wrote: > On Sun, Feb 15, 2026 at 11:39:44AM +0800, Jisheng Zhang wrote: > > It turns out the generic disable/enable irq this_cpu_cmpxchg > > implementation is faster than LL/SC or lse implementation. Remove > > HAVE_CMPXCHG_LOCAL for better performance on arm64. > > > > Tested on Quad 1.9GHZ CA55 platform: > > average mod_node_page_state() cost decreases from 167ns to 103ns > > the spawn (30 duration) benchmark in unixbench is improved > > from 147494 lps to 150561 lps, improved by 2.1% > > > > Tested on Quad 2.1GHZ CA73 platform: > > average mod_node_page_state() cost decreases from 113ns to 85ns > > the spawn (30 duration) benchmark in unixbench is improved > > from 209844 lps to 212581 lps, improved by 1.3% > > > > Signed-off-by: Jisheng Zhang > > Please note that mod_node_page_state() can be called in NMI context and > generic disable/enable irq are not safe against NMIs (newer arm arch supports > NMI). hmm, interesting... fgrep HAVE_NMI arch/*/Kconfig then fgrep HAVE_CMPXCHG_LOCAL arch/*/Kconfig shows that only x86, arm64, s390 and loongarch are safe, while arm, powerpc and mips enable HAVE_NMI but missing HAVE_CMPXCHG_LOCAL, so they rely on generic generic disable/enable irq version, so you imply that these three arch are not safe considering mod_node_page_state() in NMI context.