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 E7CF9C67871 for ; Fri, 13 Jan 2023 04:16:48 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/aVpSZl0kSp07wdCvRlek4rVqnt3PpG44cwWZCuOIRk=; b=IBkmG5wIiM+pdF QdY9l1c5GWtzsdlTHUtMdebzyrMV86OoECWq5PK455NZ47ZFjx10acTxB/fzZ3thbLH11qJZ9s4/P a7CQwJfIKqJ9yATSZVbi6LUpWtrW3iFsHy4POsYrfgcE7TnLDk022zs03fQ8Vy+JwvvXWRaIwhDwD yvIbbPEgPGlywI2EFp2AZbenGL8MD/chZhAAKaj4OcahaEKJ5h3blhI6IhHAYN0putU/vTCxng5qk f2MdOCBc8uW0C/BP86ayFy28RVyvgnV+i1lU/n93gN8XGZ/HtTtg/4hf6oPLOV+m92S0nRPV7p7hZ j5OGv3QbaoE6rn1zPLcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGBTp-000NIh-AJ; Fri, 13 Jan 2023 04:15:49 +0000 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGBTg-000NG2-Vr for linux-arm-kernel@lists.infradead.org; Fri, 13 Jan 2023 04:15:42 +0000 Received: by mail-qt1-x835.google.com with SMTP id g9so3602838qtu.2 for ; Thu, 12 Jan 2023 20:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wt3jnzhUF3EcxhYr3T4hnm8uRCL7X//ykE1nGacQiX8=; b=QW41cnynBWFCcbN2np1bR6tedxbtO3eX5SbrPn1/lU9d4aaXmlahkT2WbS3tM/if0A VzpLPqX9WvAnwx7NbuqRmOaO9xqYz/nx1EGX61d8Bj2VG4zI+F4YccXnLtgT3U3a9uMK ML5XR8tAKhK45vk0ghApza55rwDgnktIGJWc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wt3jnzhUF3EcxhYr3T4hnm8uRCL7X//ykE1nGacQiX8=; b=M3GARaRXkkG4we5gEQwB1DtnQjXu8Unn5duFqB1YPwlfTyDVJVaN0vya+MvxpPgap1 OxqM7ccs8WiBDLno7sfNV8s2AtJ0luKFU4G5K7SNo2b/fNHg6X2G4DoqBFrD5w9dMwtR Wkhpxfg2aOmDkMLITMF87cH9JKcIvGQxIdN3wPOs++SES7jxLad+8u0g3cEa8C3pwV79 K5pN9UDZCHFPC4pPmoJ8gu1ynGLf1zH15rtc4Ntye9n34WyopmwSw/4fu6PFYWJ//jsV zhXGQAOJsF56J7n8QtoEcJt5uZ5FUTa1NpT9RLXJK2ow6JaISF4+fJAQ2GV6T3LMGCCZ Q4yA== X-Gm-Message-State: AFqh2krD+jHUYHRARw40OApbYtiR7YGxOK4ThitT40yXkaBz5yFCY4Gp O5sBDaPCOlfg1NP2vXNsGeU6e4+n2rWP5KBaNjM= X-Google-Smtp-Source: AMrXdXsW4Jzsm6kFzJSo36tcc8SSNE8DhNPVMtv1gEoytDxKHfjS363fE3jFCVYv2oDprwJ3VNvHag== X-Received: by 2002:ac8:534c:0:b0:3a9:9170:793c with SMTP id d12-20020ac8534c000000b003a99170793cmr112239260qto.5.1673583339295; Thu, 12 Jan 2023 20:15:39 -0800 (PST) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com. [209.85.222.176]) by smtp.gmail.com with ESMTPSA id g5-20020ac84b65000000b00398ed306034sm10039866qts.81.2023.01.12.20.15.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Jan 2023 20:15:38 -0800 (PST) Received: by mail-qk1-f176.google.com with SMTP id o14so10295913qkk.5 for ; Thu, 12 Jan 2023 20:15:38 -0800 (PST) X-Received: by 2002:a05:620a:674:b0:6ff:a7de:ce22 with SMTP id a20-20020a05620a067400b006ffa7dece22mr4281758qkh.72.1673583338361; Thu, 12 Jan 2023 20:15:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Thu, 12 Jan 2023 22:15:22 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: lockref scalability on x86-64 vs cpu_relax To: Nicholas Piggin Cc: Mateusz Guzik , linux-arch , Catalin Marinas , Will Deacon , Michael Ellerman , tony.luck@intel.com, viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, Jan Glauber , linuxppc-dev , Linux ARM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_201541_079032_1CD0B5A7 X-CRM114-Status: GOOD ( 10.91 ) 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 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. 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). Linus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel