From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC7E3EB64DD for ; Tue, 11 Jul 2023 10:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R78CDHC3nKUKxWBeU9u40cvzN7wkXo0/3pfhYs9oD4A=; b=N65aMlW6ftz0X8 4EaeKZuUz56bDMCwMRB+hMY0pwi/YyJIIj1bowXXBBXyWhok+zc9TZ0PWVbGjloynB0gIL5ayVvhx HFI3DxGIiGMyGtmvTGgR//5I5cxNGJIW2t8BNi8xlyf3IdtiDgZBUdtdtBnMo3MAicVpbzI/mPyhZ EHNLGnibmZy9JDRQDhU1AEej+CJ9PrhsU6DsXbA1jFE31YeVG3nHX1VDJsdPmjX7eZXoqHnUjbIbx wuWrXyOZwDbtSTjc7V3/RQfwJIt0nyc/GJo+wQvsmX4tJe1C3zr6Jm+X7FOnjZ8N/KtNTjukPNdhC XZmApbS2NIsAonupf7jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJB1k-00Eh59-1F; Tue, 11 Jul 2023 10:55:28 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJB1e-00Eh2y-2O for linux-arm-kernel@bombadil.infradead.org; Tue, 11 Jul 2023 10:55:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=cUyNgU33h3MY0tbUMjLo9nHBJGV+GwEPSoKc44XkN/k=; b=RVds73W4fX1a4yqxyHVBijDD+K M/2GT30G1Za1LnvKFTqw7/PjUbqw2lIW3rUUNw6A6AoVFCAut5DRlc2o0dc/xVBzctXr/AQny1UE2 5AgFShfMQiZRh5JGOKDM3082R+lJb+zZaCCYhJyyv5M2ZVWm02Zkx7hNrpLcJFdDXbfAz0SNIqlzC VcLOC4kc3u8N8mHx+ATuQBd/FTdQzd3WG0h8diN9TfW2YMGyuLeGcV4mc8rhJz6D7ndje72IijRN4 ced0Zah19kwc336AE9AONUUkM6ngvsLpyntvYxVt6ATvG4wTcF4buKkw3vYID7cHiIe3R64Of6Qlr K2+8zT3g==; Received: from dfw.source.kernel.org ([139.178.84.217]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJAYf-002LEb-2r for linux-arm-kernel@lists.infradead.org; Tue, 11 Jul 2023 10:25:28 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 77EC76144C; Tue, 11 Jul 2023 10:25:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6F8BC433C8; Tue, 11 Jul 2023 10:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689071116; bh=TOqlJUFHaJBKmQf2cGYAl73/mk9Gcc2SsywmsziYi5I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fsBVrD0VftvJCAMA4m23UBTa2QMEpfh8VPytwt6VbmLtjVMZbDL22pwmxIYgsGvvd KPPBk+sSC3gr1EcGohswi97s3Kwup2+aZeaps9CmTPeEGTmI+r6yF3F+yDHo0PrW++ xeWdIEkQJuWPJf+hbT+SmYC5SzKWwTiMbfnzkEd7z7JwVtNiK1PRhe8Nm0RporIEc/ 6rmAZE8BYet39GdehoVcfD+RuKGLMESsIkPYCdLZScxU/b1xOwOWQnz1qo7JxEWo7M AgFTtNtXCrrKNgvx/dUdbFooaddoZEhBBnbIcgV+7y6e5hBswhaIP2IudW+48ZpQbR dPfGmovBooH7A== Date: Tue, 11 Jul 2023 11:25:11 +0100 From: Will Deacon To: "Aiqun(Maria) Yu" Cc: corbet@lwn.net, catalin.marinas@arm.com, maz@kernel.org, quic_pkondeti@quicinc.com, quic_kaushalk@quicinc.com, quic_satyap@quicinc.com, quic_shashim@quicinc.com, quic_songxue@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: Add the arm64.nolse_atomics command line option Message-ID: <20230711102510.GA1809@willie-the-truck> References: <20230710055955.36551-1-quic_aiquny@quicinc.com> <20230710093751.GC32673@willie-the-truck> <5cf15f85-0397-96f7-4110-13494551b53b@quicinc.com> <20230711082226.GA1554@willie-the-truck> <84f0994a-26de-c20a-a32f-ec8fe41df3a3@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <84f0994a-26de-c20a-a32f-ec8fe41df3a3@quicinc.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230711_112526_350500_A0248875 X-CRM114-Status: GOOD ( 29.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 11, 2023 at 06:15:49PM +0800, Aiqun(Maria) Yu wrote: > On 7/11/2023 4:22 PM, Will Deacon wrote: > > On Tue, Jul 11, 2023 at 12:02:22PM +0800, Aiqun(Maria) Yu wrote: > > > On 7/10/2023 5:37 PM, Will Deacon wrote: > > > > On Mon, Jul 10, 2023 at 01:59:55PM +0800, Maria Yu wrote: > > > > > In order to be able to disable lse_atomic even if cpu > > > > > support it, most likely because of memory controller > > > > > cannot deal with the lse atomic instructions, use a > > > > > new idreg override to deal with it. > > > > > > > > This should not be a problem for cacheable memory though, right? > > > > > > > > Given that Linux does not issue atomic operations to non-cacheable mappings, > > > > I'm struggling to see why there's a problem here. > > > > > > The lse atomic operation can be issued on non-cacheable mappings as well. > > > Even if it is cached data, with different CPUECTLR_EL1 setting, it can also > > > do far lse atomic operations. > > > > Please can you point me to the place in the kernel sources where this > > happens? The architecture doesn't guarantee that atomics to non-cacheable > > mappings will work, see "B2.2.6 Possible implementation restrictions on > > using atomic instructions". Linux, therefore, doesn't issue atomics > > to non-cacheable memory. > > We encounter the issue on third party kernel modules and third party apps > instead of linux kernel itself. Great, so there's nothing to do in the kernel then! The third party code needs to be modified not to use atomic instructions with non-cacheable mappings. No need to involve us with that. > This is a tradeoff of performance and stability. Per my understanding, > options can be used to enable the lse_atomic to have the most performance > cared system, and disable the lse_atomic by stability cared most system. Where do livelock and starvation fit in with "stability"? Disabling LSE atomics for things like qspinlock and the scheduler just because of some badly written third-party code isn't much of a tradeoff. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel