Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp668718rwr; Thu, 27 Apr 2023 06:46:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DNf6Mm+nc8DcLq8SN07nFgd29/acZ8HC1xK8R0YGMa/KGLpBHdt0+Me7NVK9Pc8hozOEf X-Received: by 2002:a05:6a21:32a2:b0:f3:d92:a209 with SMTP id yt34-20020a056a2132a200b000f30d92a209mr2031821pzb.0.1682603185761; Thu, 27 Apr 2023 06:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682603185; cv=none; d=google.com; s=arc-20160816; b=Cubjgdi6wZJuE5SYzt43C7XfgWmYQb/ry4VERF+5NKsisCClnQWj7blnCBehdvXjMz cj1ZD0+R0ldKHSjRzAKTW6RaMmL+fnQKj8in7JHwrOAt4o3VaF9nKBOHGEaMTCDz0K/6 iO23TC0j6xa8M6TAjJwrtYasz4vDqjgrcNc835xenpizVA4KXJhVxE3wAwiIg5bEDekY q28BOs96HP18bly6Ry+C4lu1K6zmtLvVFCG4bZ49+b8zPuAbGzulDPDPeA5lDO+ShV1d MtQJLJK34OKGFNCfZQTmlonQzWPycGsxwq8XSruMrUVNXaYvNfTyKHmpAnH9WDwP1Ho4 SbUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=E/9VwzYujGkLmgAKT34TJhMb4kA3dkHKyhpPXWfaEMk=; b=ghYZPqjt6tyjzD8CJO6Vw/gB+Jrx7lL6zyGFFD1eQLMwN3ffLvU2TmJnFSTN9tGlZG 65zomJlEAJrj4ZCKwGhVQyb91gHeigyFtbouEQLZKsw88+5XPHDv7ntURtzx7LM+sN50 S3BiKVgPT22zKC6oGJRRTzd9DZVyy1BwMPkGkDI0cY3PlVqW7PngP2qwBe+5Uc4Q8No0 9Upap5oiNxMkY2prNrSGbr3r3Wl5wsdasTVWKKBRxDHWocrikE6YF4enFByHG4Ps1iS/ OcQqq1Mv85Q/FCAJ+Ex8/pLc+IcvoVq1d47HxsQdTNSCR9i20pQrRkaortlCDgTU6kZl UHtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Rdc8cSZ1; dkim=neutral (no key) header.i=@linutronix.de header.b=C4EGNJlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a6560d4000000b0050bdfdf4a66si17503645pgv.147.2023.04.27.06.45.54; Thu, 27 Apr 2023 06:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Rdc8cSZ1; dkim=neutral (no key) header.i=@linutronix.de header.b=C4EGNJlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243608AbjD0NpR (ORCPT + 99 others); Thu, 27 Apr 2023 09:45:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242993AbjD0NpP (ORCPT ); Thu, 27 Apr 2023 09:45:15 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF5033C0B; Thu, 27 Apr 2023 06:45:13 -0700 (PDT) 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 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= 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----- --=-=-=--