Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1531309imw; Tue, 5 Jul 2022 11:02:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tXMK0fNyEJF+XW/qPGw6nmRwKaJM+aZVUnW1StG/1i1P4CVRHgkzyAOJE15pCkih8ub+C0 X-Received: by 2002:a63:86c6:0:b0:412:518a:8eef with SMTP id x189-20020a6386c6000000b00412518a8eefmr9292947pgd.298.1657044143980; Tue, 05 Jul 2022 11:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657044143; cv=none; d=google.com; s=arc-20160816; b=wgDcI9kxxQsyfzyxsKoylhcxF/wwSQqzc9j1SIndfohs6XAboa61hvIST/a+RT+ZgO 0yZXeiGWB7wo5UDPrbGhCUzPzai8IjTYhgk7KCnda3CnvTNV53cUkkHZjHqki3ZWz9bh v8NiBSWlxAUWQT5SNuVS7wSB/wJ0vG3cIqPOJ3k3csJxJLecIgjopcFF/yUdIVNaU1Ea 7jhruxPyuHpsy2GerZw3aCB9aFXciZNieBJ2zFmg8FIoVrsiQm8OrXp8ebsl8wKloiDa LqQuQwSXvtAkTLqnKvKWEMKwlNCsr6sF62UCAn3/BB5io8ctWsrCBbqrBqUeKh8dBiws nHaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VXivCxTYmRa6L115UXB/XCu4/NjG1O3KDoyHQDdqfn8=; b=LFh1SnePaEKtWfnwkRweDEIArh2m0HQW2p+bW7WiNw4Wo91iEG+dGPbp/BQlTTnvAr q674jTscEsfkjsbi9zsF575JDK267jhFo90oONvHNVQOlI+Gdj+ib03EstjnsEZkm/+6 LfvTABsDlwaaUpwtwLN0gioQSAOzGbtK9eQ8t6NuZFMAFWyf6Sa0dce71Kvxqa04fy4b 1pQxw8WwsXT03zvLhqDU7FMtkeBf/miOW7GzI5IQdJpQbWoElUl6di8LC+4pZqLKVFha iCQ5wtbbuI7LW+Rh+nT+VKERPP4QrK+W89Bk3R0vdyxlwUehfAtEXt4vwM6V6qhJtwsj xlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="g/CWCb+T"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m21-20020a63f615000000b003fbd7285a83si43193137pgh.817.2022.07.05.11.02.10; Tue, 05 Jul 2022 11:02:23 -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=@infradead.org header.s=desiato.20200630 header.b="g/CWCb+T"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231317AbiGERbk (ORCPT + 99 others); Tue, 5 Jul 2022 13:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbiGERbj (ORCPT ); Tue, 5 Jul 2022 13:31:39 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 766AE26D for ; Tue, 5 Jul 2022 10:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VXivCxTYmRa6L115UXB/XCu4/NjG1O3KDoyHQDdqfn8=; b=g/CWCb+Tl4E9AlK2XxK8zf7Oe4 eIRvDKJzgEx2BdlhLnk/kePb4cx3DO0fqMqP7LJlEXLufPi0Mxkp7G3W5/TnYO6iNCZ6xHWhps1fS Arp2rDu+Hg0UQYdNKUtHiKwIEWv8/Mjsn4F3QZHES1ooaEOSpEFBnCf1p3eYVH0E66OZj/utnnLtf nbypXQSU3GCIA7QTW6dFHXvCUQj2D79vd9TDvDj7zfhmuoI1FZoxn5lzJgkTNG9m1BjVCoarH5/iB wkak+OXUmHILXKOoSJo88RXYuNfV46lr1wTBbTjz4iUHdO3ZFJm6ucJ+nA/rQWaik/a54ntsHOTYZ PZ17caMA==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8mOK-0004l8-64; Tue, 05 Jul 2022 17:31:16 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id A4A64980059; Tue, 5 Jul 2022 19:31:15 +0200 (CEST) Date: Tue, 5 Jul 2022 19:31:15 +0200 From: Peter Zijlstra To: Nicholas Piggin Cc: Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/13] locking/qspinlock: Use queued_spin_trylock in pv_hybrid_queued_unfair_trylock Message-ID: References: <20220704143820.3071004-1-npiggin@gmail.com> <20220704143820.3071004-12-npiggin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220704143820.3071004-12-npiggin@gmail.com> 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_NONE,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 Tue, Jul 05, 2022 at 12:38:18AM +1000, Nicholas Piggin wrote: > Rather than open-code it as necessitated by the old function-renaming > code generation that rendered queued_spin_trylock unavailable to use > here. > > Signed-off-by: Nicholas Piggin > --- > kernel/locking/qspinlock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c > index cef0ca7d94e1..9db168753124 100644 > --- a/kernel/locking/qspinlock.c > +++ b/kernel/locking/qspinlock.c > @@ -357,7 +357,7 @@ static inline bool pv_hybrid_queued_unfair_trylock(struct qspinlock *lock) > int val = atomic_read(&lock->val); > > if (!(val & _Q_LOCKED_PENDING_MASK) && > - (cmpxchg_acquire(&lock->locked, 0, _Q_LOCKED_VAL) == 0)) { > + queued_spin_trylock(lock)) { Indenting went wild here; please use cino=(0:0 (if you're a vim user; I seem to have misplaced the emacs equivalent).