Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1514893pxb; Fri, 22 Oct 2021 02:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz9Hcf4SvJPNEqEyOBTYDpv2SNIp4Q2viEP6aV0tbQKBbfdhYCebh/sUoNz7+Zkxn1tv3A X-Received: by 2002:a05:6402:3488:: with SMTP id v8mr15315809edc.106.1634894782388; Fri, 22 Oct 2021 02:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634894782; cv=none; d=google.com; s=arc-20160816; b=lOV0JPbtsEon/IDQqqj8chwVVC3ufKNG5R5zQ4s0idkl+TNox+11k/7HfGI5pjMShd GMzCcsFVv5epdbRRZv+5RjkVMOHkXk+2+t0/72ZWGgTyjthwmlmWzT+10kfSpaDdrAE2 bTL6caEn9t/oyx+IcdrbjcqhvPe8Fv9dFE26LrvgruI8ja6WOcW4yD6lXXS3yCSNOOvz ykpBKxiuFRPkys7cxRbG5x0QbGv7AoVAPRvZc5znbes/+3bVHMsogVpaMAnezwyWovzC QUMgM3ABt9+PfgdqljEzK/QDVQvkk7O9Qc3FrOu8me0BZY82ktY/8nGWzdSRNTvpUZXn Jd5w== 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; bh=yRS+SwAcqOwoLePZPU8wZ6d1q59MVLIrf88C4lrIRKs=; b=uEPvdW8z/sSiLpdEX4BoQzOyGjGMosGQ08EL3uVvkbWnZZxZdJ9iHvULPQkL8NiEKt gDPiefft1BHjJDU24grmWfnh87Ur1cG0lwXu69XC4W3A8licaTHmvK5fmqNHL3mxBOuw tv4RAgmq0BbJcedtFjcH1YtqvbTj3eJhJzj+hhBfV3HuNSIopCCJEWYbNmZZvvtpxVp9 0IiuCoBJz50mXpmvtG58O2wsSyuI7HODoCjXwBkklMdhWsoqYrvIloX2gs/SZDEigV2t yV+cx9pmb+OxwQR6lu4/gAOvbWTgVyrntr3bnVYd+HirmiD5QyNjSu/YpOjb5rvXnMrx qQHw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn15si2054463ejc.35.2021.10.22.02.25.58; Fri, 22 Oct 2021 02:26:22 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232358AbhJVJZZ (ORCPT + 99 others); Fri, 22 Oct 2021 05:25:25 -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.