Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2849318rwn; Fri, 9 Sep 2022 23:31:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5VW8oiwTgT+F3DB/3YjvhOREwh/n9xilbG1lyRSdO7X/PjSwRR1oZG1XOajK9MsJRQWYBq X-Received: by 2002:a17:907:3e03:b0:722:e694:438 with SMTP id hp3-20020a1709073e0300b00722e6940438mr12562693ejc.755.1662791493730; Fri, 09 Sep 2022 23:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662791493; cv=none; d=google.com; s=arc-20160816; b=G6420DI5En0xwfsoKoJKMwKsB4PED1A07O/WvgR0S555nFCTJn97CzGLUYw/wrVPg6 uHvg6rTtA707nKbSRzMMRfrPruc3/GE8MIzkPLf/Z9PTkZWdoCcngMncSDv1qG6/JHLJ XvOkIHpDe0xY06Jak0dV13yf/jUX62hiuleenbCqm1IvPmbc6Tzpoe5quxSi8BvLRG0G XdxZZPbETJSQ4002xUzZMZO2ABRibMLlgs2if+cdDrEuR9d+Dn8QlhmYHpmImA25wwU0 D1GuPrl5W4YF8EewREPuGX/tFjymHrUAY8O55Ry5/t7PoF7v3Ob1i+qN0O4MhSCBWSSh O6vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VVGMPzF4qPTcVF0S13mk7tfi+gz326IHs3V7xzCu89k=; b=EfJWFwh5sJ1FuaRXkQicFKoAOyr00wVFeeNEX8yjMFhhJraji9IF41deUWdxlZQP3w ftLK4ZejdxydAkdJNQsfQfEvbhM0eYSEQSh1hn54T+wK3ugJD2kaPlaKNp+9aKK+3Lxh yLJWZLGNjsNANl4KEqn0NMwvbJfgrasFEK2rMCZO54hztQbbSaJAemRu3NUgblyuZRbo QZFgbi6n3IPLiL1ifWV/J8itEHngqAZgmvHbSqNHn2F4xMmrOXO1jkRe3mLWDUlFUM0g LjXPE960RaJObL1JiAqx8vV5nboBJi5+gEaC152IUGEreoUg6lkwZs9f3luEMnS9dhA0 UECA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q1yactfH; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a05640226d400b00448ce617058si2522141edd.463.2022.09.09.23.30.49; Fri, 09 Sep 2022 23:31:33 -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=@gmail.com header.s=20210112 header.b=Q1yactfH; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbiIJG2i (ORCPT + 99 others); Sat, 10 Sep 2022 02:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiIJG2f (ORCPT ); Sat, 10 Sep 2022 02:28:35 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E58C09E0E6 for ; Fri, 9 Sep 2022 23:28:34 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id d189so5578902ybh.12 for ; Fri, 09 Sep 2022 23:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=VVGMPzF4qPTcVF0S13mk7tfi+gz326IHs3V7xzCu89k=; b=Q1yactfH9fHoBlFjLh/RkEEKZc3eMN7+1hST+ET0eD8TuzAbVHOIwT/SgxBsaOTOmw G1WGrYmr4IUkTkMAy/hg1UIFPTIKs91bN8kjU75OSnlWcHwbymrr+YXXBO+HSeMxL4ae 3rImXB28cfFdSo5K/0RASIr9653GanFYqkkHqAk2E8YU9z8RakvPenpLqdspbdMYEgHn zwcK5R8EMG9BTqPEcP5HG9Gq4fFc8zA1mxXrNrI3BqTYYKd1OgoUsfABSRdkkwXbL+O9 crCRzFvo/k2hIUfVWB0Z4bTI2j9D0h1jTQkgqsP1hsu2KTndX/Xp1UMyzcInHNTFSgIb U06A== 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; bh=VVGMPzF4qPTcVF0S13mk7tfi+gz326IHs3V7xzCu89k=; b=xdej5MX8guyzuhsZX1S+MXg/qyzZqoc8yizPpPsz5XgXbP2rFLE/VJfbAhLUml+3to UiR+Ripjl0X/w89+E6cEOOCEIEBC1GsINSbGVQRnC6ug5iNEpcmbbx1Qjtx2zIqYpf3Q ML0230EEpmj8BGB+n26jRSST7mU2DzRYuDEe9GUL2rm0b45MF7573+3EWZIxXcvqJhq5 wy+Vi7nk7lFdYfpJnKrz8fZ8lTDbtcr2faBFSRMIoL9z/PUkiNRT5qHvQJjr7pPpjVne P5y4fB+oLlLZBzcs8swSu4jEaXK3X6EeQo51UyiPt+xi58GnyoZ8SS7ujhPS9eee2aNP Xb5g== X-Gm-Message-State: ACgBeo13SJDvPARqZECn8aqlaTcfrEuMaJCAC/YyrcAVOrCxQHiTeCbd He1BtTOeuG8bp8k2ykKQO7h+atkKb1FFGDrsQA8i3Z9PgTE= X-Received: by 2002:a05:6902:56e:b0:6a8:f726:79cd with SMTP id a14-20020a056902056e00b006a8f72679cdmr14066826ybt.209.1662791314058; Fri, 09 Sep 2022 23:28:34 -0700 (PDT) MIME-Version: 1.0 References: <20220626201712.18064-1-ubizjak@gmail.com> In-Reply-To: From: Uros Bizjak Date: Sat, 10 Sep 2022 08:28:22 +0200 Message-ID: Subject: Re: [PATCH v2 RESEND] locking/lockref/x86: Enable ARCH_USE_CMPXCHG_LOCKREF for X86_CMPXCHG64 To: Linus Torvalds Cc: "the arch/x86 maintainers" , Linux Kernel Mailing List , Peter Zijlstra , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Sun, Jul 3, 2022 at 11:01 PM Linus Torvalds wrote: > > On Sun, Jun 26, 2022 at 1:18 PM Uros Bizjak wrote: > > > > Also, by using try_cmpxchg64() instead of cmpxchg64() > > in CMPXCHG_LOOP macro, the compiler actually produces sane code, > > improving lockref_get_or_lock main loop from: > > Heh. I'm actually looking at that function because I committed my "add > sparse annotation for conditional locking" patch, and > lockref_get_or_lock() has the wrong "polarity" for conditional locking > (it returns false when it takes the lock). > > But then I started looking closer, and that function has no users any > more. In fact, it hasn't had users since back in 2013. > > So while I still think ARCH_USE_CMPXCHG_LOCKREF is fine for 32-bit > x86, the part about improving lockref_get_or_lock() code generation is > kind of pointless. I'm going to remove that function as "unused, and > with the wrong return value". May I consider this message as a formal Acked-by: for the patch? I'll resubmit the patch with a commit message updated to reference lockref_put_not_zero instead of the removed lockref_get_or_lock. Thanks, Uros.