Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp395279pxj; Thu, 27 May 2021 02:49:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcJliAWE754gM/+5axEqQrtcOL6Hk2xO046uZgKSz/N07krCZEDDmYnCerGaOEr86xARs0 X-Received: by 2002:a17:907:75e9:: with SMTP id jz9mr2870711ejc.314.1622108989460; Thu, 27 May 2021 02:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622108989; cv=none; d=google.com; s=arc-20160816; b=TMt8ajdONTTdWltAYy0TEjWWcs4vbMLRRQfQrJq5CewPXbLhK4tzJlPgCSe3amZ24i SfURwN5DFR1n/81qw77v/s+RDtxQmAVrmFWjNQnlaS50Q0r57hFe2exm++fpoJpEaQ8+ Mmmr/qQnF4DcmBoiDmIjIeZNgef17plLLqWNjlkmVzG+PaQn8KiAu2p9Oq3iA0Qi5IJe IBEwxEwSLukWlb1/uZxFsg8HC6/ixq+XWGGYvk6/51NPW8gBiwqDjOBzWjY+kLxKUYCs OXVB9ZG7MS4ut7n8DVANVpZD1oewB3dSrt+TOtPkSh49rhitLb0O1YJPGqth++XPGP+u e63g== 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=n7pbimY5RhMCrIFl8a7lT/d6/Mh0XzzXYzygTqnwBzg=; b=hKS90H8qH2hvNGcmCps2TlbVfU9SYm98VXoqalKJZp2QO2lhctvTarG6NCYTO0QmnG C5yy0lOZJl+8tTEi3kq/WizoUfz8CnafdaSU5m1Sa7Ar4o4aqmKMvqKn9aImIOeXA4+y b1XB8XU5GjmJa5k8/vghc9kl7NegH/PHrBwuDKAFMYUmhHVGT6BjN0IkadDwiWgP7a7r Ngl642rQkSKWCDj8eHZDhzHc3Dabu6tWInB6Z/NZj9nreQu6/6X6S/LGY3iWWiFJSZmL W5JZ5YQy3Cza4Am5RLmQ25dwNoYR90BL6zRcJOTW1GVTNKVJnTX8G/uIwgGuingbtFjX e1gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=t6OC6OuD; 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 eb8si1861095edb.574.2021.05.27.02.49.25; Thu, 27 May 2021 02:49:49 -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=t6OC6OuD; 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 S235724AbhE0Jrz (ORCPT + 99 others); Thu, 27 May 2021 05:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235675AbhE0Jrx (ORCPT ); Thu, 27 May 2021 05:47:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C43C061574; Thu, 27 May 2021 02:46:19 -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=n7pbimY5RhMCrIFl8a7lT/d6/Mh0XzzXYzygTqnwBzg=; b=t6OC6OuDTPgxV6GBKtZHindnvr By7STzKnKW9CXowUsfozY4Lu+VizxQo20GobPOoc8WO1t825WDf8Lpx2dKNdsfFvbYta0pSyQoEmq VvWyeHkBznOmqGNxI2jPSdJiAqeV2z9e/sLwmpHRZhRoX+qf89egUvt79XWvhzf39tvBSGhrzAOIh GT6tgUyh1jWaCArH98jfw3yYZ7mu8uG3s5ztkrRpuKCQWkR0cAxnuLlgsVYYADS7DgfggDZIfYGZy /GIamZEPxr5y85A17zLJb2OVyrigmo6bTCKOoC5u2BDTf3i5bGckvWa/nhf+AEV7UVXSpcCDUArS3 9HbbWS/g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lmCZv-005OsO-Mx; Thu, 27 May 2021 09:45:32 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DC610300202; Thu, 27 May 2021 11:45:21 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C2D79200AA2D1; Thu, 27 May 2021 11:45:21 +0200 (CEST) Date: Thu, 27 May 2021 11:45:21 +0200 From: Peter Zijlstra To: Adrian Hunter Cc: Leo Yan , Arnaldo Carvalho de Melo , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , Andi Kleen , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/2] perf auxtrace: Change to use SMP memory barriers Message-ID: References: <20210519140319.1673043-1-leo.yan@linaro.org> <3c7dcd5d-fddd-5d3b-81ac-cb7b615b0338@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3c7dcd5d-fddd-5d3b-81ac-cb7b615b0338@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2021 at 11:25:40AM +0300, Adrian Hunter wrote: > On 27/05/21 11:11 am, Peter Zijlstra wrote: > > On Thu, May 27, 2021 at 10:54:56AM +0300, Adrian Hunter wrote: > >> On 19/05/21 5:03 pm, Leo Yan wrote: > >>> The AUX ring buffer's head and tail can be accessed from multiple CPUs > >>> on SMP system, so changes to use SMP memory barriers to replace the > >>> uniprocessor barriers. > >> > >> I don't think user space should attempt to be SMP-aware. > > > > Uhh, what? It pretty much has to. Since userspace cannot assume UP, it > > must assume SMP. > > Yeah that is what I meant, but consequently we generally shouldn't be > using functions called smp_ Of course we should; they're the SMP class of barriers. > > So ACK on the patch, it's sane and an optimization for both x86 and ARM. > > Just the Changelog needs work. > > If all we want is a compiler barrier, then shouldn't that be what we use? > i.e. barrier() No, we want the SMP barriers, smp_rmb() happens to be a compiler barrier on x86, but it will be dmb(ishld) on Aarrgh64 for example.