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 8FA7AC77B73 for ; Thu, 27 Apr 2023 13:46:18 +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-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qngVzPBv3pZkZ4EZV86qJMzHlbVwU3nHMh3wiXDeX2M=; b=vfAPjDndwuiWB8kHqzJwKZuIDb IOqW7kUTgfQpKT2rBCymiZGqpMUMet9xgh7ZRVARsTt4mbOwwhZU++g63q0+9Pvq1DY2fcl4fECfq Zjpbj2GfuiNhVt+1Iix5cQuRGspt65aO9xfjjTiHQAPCXc0QNO6gXoSEfvGk69ByY6NuOF7i3d31C xRnBhOLJQWYunkIWEsIYMTglQkLCElH+xy8acpEox8RYj/MQk2L06K2TBgaAGlDqTLTqk33Ap0Hms LLP9yBJUTdaUFu0sXp2NxsxOJqCaFQ2kJ3HfApvq4UQCOE1l394vp0ZRIFNMtMF8wx6KT6LGLfR7i bobaEQQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ps1w0-006g2X-2G; Thu, 27 Apr 2023 13:45:20 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ps1vx-006g1m-24 for linux-arm-kernel@lists.infradead.org; Thu, 27 Apr 2023 13:45:18 +0000 From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682603111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E/9VwzYujGkLmgAKT34TJhMb4kA3dkHKyhpPXWfaEMk=; b=Rdc8cSZ1Z9Gm6lo8OpkEQNVS7sbW2i4fFU7/rawBjfBgqGOb1PZlrJgXQy6dtmY0lJQrxx 0m1I4Pkeg5JWVtBOYUVEbBE/udGNMOllL0k79zhv3XFlQlmH2mnQOURddOoj5EJpi2TCKM YyYwL8mth4oY0ztfZ14Im4nx4Y5mMS6UjR1KqdLhby7Mymh4mB/20dLmUaz6CMPAvvUTkq w4EZae8hnp5PKYM5fVITntTz+wSQmaUer09nizl6IW9xLhM8va3Dw6IhPK2mI3TK9FwfYT BRXLg6yl6t2DcGkbxPCn0AccHkDhKg1B2fQOEjfN3sLLmt0wnw1WjbzNNt5fcg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682603111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E/9VwzYujGkLmgAKT34TJhMb4kA3dkHKyhpPXWfaEMk=; b=C4EGNJlSWCzjxxRFjrxKs+UC2lwlwm3z7d0lsX1U4ZNRmBusnVaENfBppKn/B254qb4wef 0Ffza/i61x0YPjDA== To: Jan Kiszka , Thomas Gleixner , "Bouska, Zdenek" , Will Deacon , Catalin Marinas Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-rt-users@vger.kernel.org" , Nishanth Menon , Puranjay Mohan Subject: Re: Unfair qspinlocks on ARM64 without LSE atomics => 3ms delay in interrupt handling In-Reply-To: <19641ab0-ab6a-9af7-8c64-34030e187848@siemens.com> References: <87pm7qxrg6.ffs@tglx> <19641ab0-ab6a-9af7-8c64-34030e187848@siemens.com> Date: Thu, 27 Apr 2023 15:45:09 +0200 Message-ID: <871qk5782i.fsf@kurt> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230427_064517_846622_87F32625 X-CRM114-Status: GOOD ( 13.48 ) 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: multipart/mixed; boundary="===============7331608242199190474==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7331608242199190474== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu Apr 27 2023, Jan Kiszka wrote: > On 26.04.23 23:29, Thomas Gleixner wrote: >> On Wed, Apr 26 2023 at 12:03, Zdenek Bouska wrote: >>> following patch is my current approach for fixing this issue. I introdu= ced >>> big_cpu_relax(), which uses Will's implementation [1] on ARM64 without >>> LSE atomics and original cpu_relax() on any other CPU. >>=20 >> Why is this interrupt handling specific? Just because it's the place >> where you observed it? >>=20 >> That's a general issue for any code which uses atomics for forward >> progress. LL/SC simply does not guarantee that. >>=20 >> So if that helps, then this needs to be addressed globaly and not with >> some crude hack in the interrupt handling code. > > My impression is that the retry loop of irq_finalize_oneshot is > particularly susceptible to that issue due to the high acquire/relax > pressure and inter-dependency between holder and waiter it generates - > which does not mean it cannot occur in other places. > > Are we aware of other concrete case where it bites? Even with just > "normal" contented spin_lock usage? Well, some years ago I've observed a similar problem with ARM64 spinlocks, cpu_relax() and retry loops (in the futex code). It also generated latency spikes up to 2-3ms. Back then, it was easily reproducible using stress-ng --ptrace 4. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEvLm/ssjDfdPf21mSwZPR8qpGc4IFAmRKfGUTHGt1cnRAbGlu dXRyb25peC5kZQAKCRDBk9HyqkZzggoHEACMsWklttHdQxg1mAdw4DJQahKd0oB/ 36cdl4TJeJ9BRcROss1tiaHyLzYsbYPbjdaG7CRI2AKAHMfI7+Fd55b2lOq59gM7 rUGNkTcGub7z6wvkMS8JrxJKeq1EAFZkOVwouOO+XNlvKLV7sj+2/tkL5iN5hwoh 9tOjCODa/MaQIy/+CmGVAj34yQok8P3x5mm54e4S8JZ/VtQzaoL1KiOUxzXNnj5m g+zCF2nRQGpkTmXKcNT2uW1pbJ3XJLMU5JXzKrjS/rPoqznTzGyVrYUF/EeDjMOM MEjcQeskgUT9G5I4J4CTH+eZ9XtjcnkebMgTuPGO+FppByycxEuSeff3x0JE0tKL YEuVJdvCfuL9vQ+Gbjxmf8gYXpTqZXBR/69D95yu1yCtbPk8i3rqUYT9AEKceMvD yEyJexbRSMcpJGuxBaQfhsfrTUALylgSft8uL0wM/ACRNZbNMay+2m3Ml39w7F1i /34V8vnvpPuImcUBqW7wA+Nr5w8I8qW3mlJE06FyKu9b5QsNIo+euHUOkMM2flIO WtM1q+rXyn23ZWYNM18Flc3nAMrvqbHca+lR23jsm0ArNISnkUOdZwZDtW9zkZWX RYvvJa2bH+WJ+gfRwfx+kSPga33P9UMKcg191JONEWuJIN7d3DfPmPc0xgELijyE eg2SNQ5F5MZlxQ== =77G/ -----END PGP SIGNATURE----- --=-=-=-- --===============7331608242199190474== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7331608242199190474==--