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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AECD1C433EF for ; Fri, 22 Oct 2021 09:23:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96A0561183 for ; Fri, 22 Oct 2021 09:23:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232458AbhJVJZ0 (ORCPT ); Fri, 22 Oct 2021 05:25:26 -0400 Received: from foss.arm.com ([217.140.110.172]:51928 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231563AbhJVJZY (ORCPT ); Fri, 22 Oct 2021 05:25:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 46697ED1; Fri, 22 Oct 2021 02:23:07 -0700 (PDT) Received: from FVFF77S0Q05N (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 20CC63F70D; Fri, 22 Oct 2021 02:23:05 -0700 (PDT) Date: Fri, 22 Oct 2021 10:23:02 +0100 From: Mark Rutland To: Peter Zijlstra 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 =?utf-8?Q?M=C3=BCllner?= , Stafford Horne Subject: Re: [PATCH] locking: Generic ticket lock Message-ID: 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 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. Thanks, Mark.