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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EE63C433F5 for ; Tue, 14 Sep 2021 09:54:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 739BD604D2 for ; Tue, 14 Sep 2021 09:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231133AbhINJz0 (ORCPT ); Tue, 14 Sep 2021 05:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbhINJzZ (ORCPT ); Tue, 14 Sep 2021 05:55:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD03C061574; Tue, 14 Sep 2021 02:54:07 -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=HzVSq1XIeMQlq+43u9syPBolFTQN4qCc15a9vK7VI9k=; b=tUwF3hqI4TOWr/QlO4sw8LpL6O dWGBz7pIv0AxHzXZF7E2tiL7u7MmNUVRGrDlqkevIPx9IJjOit63RwEFVSyzlWCvDbjaHf8qRC3nj q9jKIoS6Buzsq5Mrwz4cQz4jyT/BE2zu881nZjsAjgxL0zYnHdk2aDZ+IGT1yW0zbp6VP2xfyxFI8 U/Ag9xzUNLsy4xhgmDuHWaEPkLsiBhn0pI7PRb++dYAivICzhRA6tMtRqm9XTRaWQtEIC34DiV11+ 4D9yLsB7qvBEhRpkCDYViw5qy5nyUfbe1jIA0zZulqnpLPud+BnRN1iC7Tbl66tOXpbRK09hg5zch 7TCT9Dpw==; 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 #2 (Red Hat Linux)) id 1mQ56I-00EXBA-Pi; Tue, 14 Sep 2021 09:51:56 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 867BC300255; Tue, 14 Sep 2021 11:51:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 702AA2D0615B3; Tue, 14 Sep 2021 11:51:36 +0200 (CEST) Date: Tue, 14 Sep 2021 11:51:36 +0200 From: Peter Zijlstra To: Leo Yan Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Michael Petlan , "Frank Ch. Eigler" , Song Liu , x86@kernel.org, Daniel =?iso-8859-1?Q?D=EDaz?= , Andrii Nakryiko , Alexei Starovoitov , Sedat Dilek , Andi Kleen , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org Subject: Re: [PATCH v5 4/9] perf/x86: Add compiler barrier after updating BTS Message-ID: References: <20210809111407.596077-1-leo.yan@linaro.org> <20210809111407.596077-5-leo.yan@linaro.org> <20210829105657.GC14461@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210829105657.GC14461@leoy-ThinkPad-X240s> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 29, 2021 at 06:56:57PM +0800, Leo Yan wrote: > Hi Peter, or any x86 maintainer, > > On Mon, Aug 09, 2021 at 07:14:02PM +0800, Leo Yan wrote: > > Since BTS is coherent, simply add a compiler barrier to separate the BTS > > update and aux_head store. > > Could you reivew this patch and check if BTS needs the comipler > barrier in this case? Thanks. Yes, a compiler barrier is sufficient. You want me to pick it up? > > Signed-off-by: Leo Yan > > --- > > arch/x86/events/intel/bts.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/arch/x86/events/intel/bts.c b/arch/x86/events/intel/bts.c > > index 6320d2cfd9d3..974e917e65b2 100644 > > --- a/arch/x86/events/intel/bts.c > > +++ b/arch/x86/events/intel/bts.c > > @@ -209,6 +209,12 @@ static void bts_update(struct bts_ctx *bts) > > } else { > > local_set(&buf->data_size, head); > > } > > + > > + /* > > + * Since BTS is coherent, just add compiler barrier to ensure > > + * BTS updating is ordered against bts::handle::event. > > + */ > > + barrier(); > > } > > > > static int > > -- > > 2.25.1 > >