Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1668080pxb; Fri, 22 Oct 2021 05:36:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu9ZogHEPNlvoajosPaROCgZiKn5OoNUJtDOuJclp2JzurjdBBQwI/w6pfYombg0m6wOpm X-Received: by 2002:a17:90b:1b4f:: with SMTP id nv15mr14636063pjb.78.1634906161325; Fri, 22 Oct 2021 05:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634906161; cv=none; d=google.com; s=arc-20160816; b=NRFiOuzdpOq+hH6JkSjHH+c/nRXsJqaH3U/dclni0164aBr2AO4Oh1Ap6s2gqJ7FQ9 gh4olK5b1dTo6iwX0IORm3POUb5u7IKS8ruEeU/8H57AM3x4mVZJogDi7tPpmtrD/O26 PzV1Uw6toHxP9GcJ3tZLSqa4O7nCw0zD13PIlgm5JbKG2ZmbMgN7J6j/GNCloHwtYeja A2jYU28VUOUOmK70CF347hh8T8aUfYkVJbVBx66iq3TaVfE6Oi1Ufxbg+H/eNJTgec8m Lc5BHaq2Mm30KVghgWIZkPuIK/7wBTBvdwc1mTEhuAVv46hF64IVC/Gy598KLkhB2Enr SCQw== 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=+iqfxl1bOnUqQBYQwxlUeaPnvsk9jRCJKtP69+WVQmw=; b=yXYrR3uT1J9yLmTB6qrnVXUY9EAdiEdpijrcDv6Ay4wa4i5kSojOxKY+/IgX9MRUwK yT01+13kBDuQLuc/qjOAiEw3HxaGO5aQgbigMOKME56DViORSSHxK1zM7ahXkjceYnDt OuhnPi+H1J5UFuwIWjGntyt44aoirKTs6GxTqRHY3CPd+oqCZZSBZJ5FWZbwJQaESIHp NXcLfTU93WNJsBViLxLS47EIsl55ZNpDj+rSBkS237DExZPL9dmg2xNxyaXV80WEMUYq /WOaLzLn8r3BXxnZ8BLKFqx0Z5k0j1lSpEwbm16+/I7p+uGK0/KWUbAq92yyE1yy7kZK dWqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FaAS0eZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 188si10758549pga.6.2021.10.22.05.35.47; Fri, 22 Oct 2021 05:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FaAS0eZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbhJVMgA (ORCPT + 99 others); Fri, 22 Oct 2021 08:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbhJVMf4 (ORCPT ); Fri, 22 Oct 2021 08:35:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1177C061764; Fri, 22 Oct 2021 05:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=+iqfxl1bOnUqQBYQwxlUeaPnvsk9jRCJKtP69+WVQmw=; b=FaAS0eZKYrwXkNRSph0rdnR8sp bVG0WLZEfA0LSIUeBcySJUff3gzVVTTxhIfH2fLLEKTjaH0Q9hm+Dh4mRpVo4RMPDXJp+IGH4JOEg o41/AyGAW7u/Kn89THveZCo9FyHs5RCpX++HIy19BqU9vbWfoYtqFJ6ufYKSthFABy33u9FB1cuUp GCks1N2qn2OS+OiEApHJNXU76IFnjAl+7WDW8lTSDaQ/NynIG0Sgf7Fs/ZDWWXR9u84N+23ztmbp2 ezhMOMzh7vjymWyloyJkmFgUCYk1q4G3jNkY+RkK7NIyz6bd88mBBU8ctCchAlvGBcV6VO+I2HQTp B/8/oDIA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdthN-00Dtq7-V5; Fri, 22 Oct 2021 12:31:16 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D67509812EB; Fri, 22 Oct 2021 14:31:00 +0200 (CEST) Date: Fri, 22 Oct 2021 14:31:00 +0200 From: Peter Zijlstra To: Mark Rutland Cc: Will Deacon , Boqun Feng , Ingo Molnar , Waiman Long , Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Guo Ren , Palmer Dabbelt , Anup Patel , linux-riscv , Christoph =?iso-8859-1?Q?M=FCllner?= , Stafford Horne Subject: Re: [PATCH] locking: Generic ticket lock Message-ID: <20211022123100.GZ174703@worktop.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 22, 2021 at 10:23:02AM +0100, Mark Rutland wrote: > Hi Peter, > > On Thu, Oct 21, 2021 at 03:05:15PM +0200, Peter Zijlstra wrote: > > +static __always_inline void ticket_lock(arch_spinlock_t *lock) > > +{ > > + u32 val = atomic_fetch_add_acquire(ONE_TICKET, lock); > > I wonder, should these atomics be arch_atomic_*(), in case an arch_ or raw_ > lock is used in noinstr code? The plain atomic_*() forms can have explicit > inline instrumentation. > > I haven't seen any issues with qspinlock so far, and that also uses the > (instrumented) atomics, so maybe that's not actually a problem, but I'm not > sure what we intend here w.r.t. instrumentability. So far it's not been a problem, and as you say, if we want to change this, we need a larger audit/cleanup. IIRC there's a potential problem in the arm idle code (noinstr'ing the idle code is still on the TODO list somewhre, hampered by the need to create more tooling).