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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 AE15DC54EBE for ; Fri, 13 Jan 2023 05:37:36 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NtVYV6R3Cz3fDH for ; Fri, 13 Jan 2023 16:37:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QqJsZWNJ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::630; helo=mail-pl1-x630.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QqJsZWNJ; dkim-atps=neutral Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4NtVXN6S1Gz3cD9 for ; Fri, 13 Jan 2023 16:36:34 +1100 (AEDT) Received: by mail-pl1-x630.google.com with SMTP id p24so22384186plw.11 for ; Thu, 12 Jan 2023 21:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t6+pSwox7nvOrX3DcFjVuwZuoLpU/mTInToIx9lpnOk=; b=QqJsZWNJ2uhmkCsES7RSyK/45OPE6gk0Ti9FTuENRviNFRQOxZ3CGCAiq6Z2fpIrE7 DZh65cqk9G1w/Ah7bP+K0q56LCJVZCBzXEk19rws00zlG9C/sMVsmnATblfeMg9OiBz8 PVf/ubSpG1MWXytZwcpTWDPWRfcDzRemhHuaheMQROx+JJC/7je4SpHIuvEEksnQOt+5 yGWSLNLC6DVzvw+jkoU1QL7K+1OKrDyt0UeHuv7k46Nr81wzogaxWKJZssNpjtHX6YS2 G34XyM2uQBuaE+BR/6KJB70UBMqSoqHaGCGaAUoMBZyi6J/CLTtkdvunkmb/XVBJJPki 7GWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=t6+pSwox7nvOrX3DcFjVuwZuoLpU/mTInToIx9lpnOk=; b=4InT5ss7sb0aqruiLr4sdueaMu4qJ1Kvyj8x0siNbe87xftqbEnKK0WYMi1ud+hpux 61t3MzwPio4aIov54xVQo4ZlRRPgsCfJDAgSF1BAhKp6LU27+XT18rzk0EkMo0FvNqSb dvk3erKYj1Wd3W5kbEJ9tfu8VXlFfGXfPZR40EfuqlRkoiXePjrGuT81FMaVDxFKDg+K weJAox9rF5SoGZcozbkmrWvYLxbKukPx+PSJShfn+QsCMVcyeNiUT4kdS9CtS9/A5FAQ RVlFDL/gWOrYaw5aMOIw2TFMgb3BiVRSbsMEbMi0eI7n5blU9EShvwECsojZRHhR+uB3 u85Q== X-Gm-Message-State: AFqh2krcXf2G2sfQWhD9Mvst2OtVOynrlokgEmKOqxC9UtPrxeTjcmrj 6G1P68OG+lies5H22l5X/e0= X-Google-Smtp-Source: AMrXdXsAusqKnG3jBsLdJrhaGyX+g1MJ5aJKfF+C/Ql9K9ixqRt11Dq+YZPlY+Crg24/8/AWo1EUOg== X-Received: by 2002:a17:902:8d95:b0:192:8d17:78e0 with SMTP id v21-20020a1709028d9500b001928d1778e0mr56046828plo.42.1673588191816; Thu, 12 Jan 2023 21:36:31 -0800 (PST) Received: from localhost (193-116-88-198.tpgi.com.au. [193.116.88.198]) by smtp.gmail.com with ESMTPSA id f17-20020a170902f39100b00194706d3f25sm360376ple.144.2023.01.12.21.36.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Jan 2023 21:36:31 -0800 (PST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 13 Jan 2023 15:36:10 +1000 Message-Id: Subject: Re: lockref scalability on x86-64 vs cpu_relax From: "Nicholas Piggin" To: "Linus Torvalds" X-Mailer: aerc 0.13.0 References: In-Reply-To: X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch , Mateusz Guzik , Catalin Marinas , linuxppc-dev , tony.luck@intel.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Jan Glauber , Will Deacon , Linux ARM Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri Jan 13, 2023 at 2:15 PM AEST, Linus Torvalds wrote: > On Thu, Jan 12, 2023 at 9:20 PM Nicholas Piggin wrote= : > > > > Actually what we'd really want is an arch specific implementation of > > lockref. > > The problem is mainly that then you need to generate the asm versions > of all those different CMPXCHG_LOOP() variants. > > They are all fairly simple, though, and it woudln't be hard to make > the current lib/lockref.c just be the generic fallback if you don't > have an arch-specific one. Yeah, it doesn't look too onerous so it's probably worth seeing what the code and some numbers look like here. > And even if you do have the arch-specific LL/SC version, you'd still > want the generic fallback for the case where a spinlock isn't a single > word any more (which happens when the spinlock debugging options are > on). You're right, good point. Thanks, Nick