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 9B6B1C54EBD for ; Fri, 13 Jan 2023 05:38:01 +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:References:To:From:Subject: Cc:Message-Id:Date:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EJl3VdC2KhbpiAKlxcRYBBpSo2TVTv4jVAvQgdaRdCs=; b=T0PKisw98U6UXc 70RoO7L24h8k2LQ8qU4qJR+iyxj22zSw/2E9fO3CT06TncVIHicQ0CBsnwfvqXTE5w2xoqEdOL4f4 iGFI4FOg+FADkTUg7/pOZhPSyDqmvoLN0plE/MLwQSGl8v1ZJwl5mJeS/n859JNIjC2TJ//1YUUg9 boGSnJMryD8oCtAj4g2jnnRwFZKFHr1NpdxqKnNtx2rgado8QfCJBWxDtuI0F/arlKmhI6LVubZ43 rsxEovPmWX7Ro0/UbTxq7SPSH8MRaAmI0RVWoHfQVH8I004vZmcMoYf0aouFXvjaEYpw8vTYCrOto gmxwOvPXP2gBGVDb4WAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGCk6-000WnM-J9; Fri, 13 Jan 2023 05:36:43 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGCk0-000WjQ-D3 for linux-arm-kernel@lists.infradead.org; Fri, 13 Jan 2023 05:36:37 +0000 Received: by mail-pl1-x631.google.com with SMTP id v23so17498384plo.1 for ; Thu, 12 Jan 2023 21:36:32 -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=uToFqHX0BYN5R5wmrhLcF80DQ8IgDYAQzJqH8RD9NmwfFR1Ev1emN8D1cBKin/kUf2 FlHrqqQlHmqqCm5+aTxNXL7CauQXYc7uiLlsjUhPXHrOofHDvBXtZxIefN6XUZnlZDex EBkeI30evsZCjLmpsJfOiJyikfJ4drzmrXNzNn5LDbP4mG5FRp4pJ/dx+w0qmyoP6Bep D98oHiT1Kj/7smBgSXpbPI9MIAwqpX24LaPp7dcR+Gjhxi+FXkgqSXyp4rAUosmjcIoN sUKGTy+2KosIJzeZzfbxud5T3UEbn5GJeB1yUm0ObVVB2fPTWHlJ//CiXSyRxpkpoRM8 Dlkg== X-Gm-Message-State: AFqh2krJbQ0q08bZ4xsKDaK/g7rx4MAzaNMmLHn8d9azTSEr26CkKxM9 FQ31Zi6qn0cVaFZW4RWCrz8= 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 Date: Fri, 13 Jan 2023 15:36:10 +1000 Message-Id: Cc: "Mateusz Guzik" , "linux-arch" , "Catalin Marinas" , "Will Deacon" , "Michael Ellerman" , , , , "Jan Glauber" , "linuxppc-dev" , "Linux ARM" 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_213636_655447_6E4EF5E0 X-CRM114-Status: GOOD ( 14.36 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel