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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 47C6DC47094 for ; Mon, 7 Jun 2021 15:33:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BD1B60FF1 for ; Mon, 7 Jun 2021 15:33:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BD1B60FF1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SLYXkP/lIiPvfvfKi5vjgYHxRvKviqkANFeFynm57WQ=; b=xQY74rwb5XJZdn WgYl3KXAmnGSocjMNXHjHh8DuBVS+ih5BCNPDanT2tRsd7WVEndseuOSm/wdp2QpTKoMjcPrQB6RN VxCG7YyebEHV0aJ+9qd+mS4wfLfsahaQB4p7oTBLWIfnEv3CNAQF7AiBDLvZCHH3FuBl+tqXn9AIp Fr4q7QobQ/8Jnxiy2P/TWbhEJJX96cLLr1VV4+P0YZdXGpL3p4cLbHlsojNrtRvO5c17wN2pYy2NZ 1nmy8H0R/qQ97R03rAALtzaDr4CnX8VrUBI8KVoUbhs/vyLJsIhfj5Y4+tWDRixCcrUR4dxRvD4J0 lag+N/P/tUGb33Psq1jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqHDx-004FrN-7f; Mon, 07 Jun 2021 15:31:34 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqHDt-004FqO-0T for linux-arm-kernel@bombadil.infradead.org; Mon, 07 Jun 2021 15:31:29 +0000 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=HXKPhHJ/OxcNx9Z7QBJwmF3Ys6qbT/gmbqDsN+FHdL0=; b=PWUaxdXqF9W2sqmRqmXdbAOiyz f2FeLrrcJA2U6wMm9DcLBtgv9A0itFecu6kt9RMkG4Z9cphEg2+6Upg1FZuTR8cWCufXrwBUC+95E ThXhaiHfbHs3hWzTZ1vN5WtpDlQAsX5feUkX4KSTPscMEWUd3w+6SWaF8jIetdO6FBDPAjexBm8E1 jBLrT/Pz2koWc3IkOyjmIp1D02K82SSWEA5LJgBkxivWq4qfzmcR5/efX3FDmzR5CZC9/blVQWT/t 4XEO5RSCiRjFNtNolxG+cMm/puaYP6UsAqfmd43avZY2r9Zu53PyGmrSLA5t7D+1Ytsm7SOd8MhZj zc4S1Ryg==; 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 1lqHDS-00Fwhs-0b; Mon, 07 Jun 2021 15:31:06 +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 9F88630018A; Mon, 7 Jun 2021 17:31:01 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9012F2D6A7343; Mon, 7 Jun 2021 17:31:01 +0200 (CEST) Date: Mon, 7 Jun 2021 17:31:01 +0200 From: Peter Zijlstra To: Leo Yan Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Adrian Hunter , Andi Kleen , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 7/8] perf auxtrace: Use WRITE_ONCE() for updating aux_tail Message-ID: References: <20210602103007.184993-1-leo.yan@linaro.org> <20210602103007.184993-8-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210602103007.184993-8-leo.yan@linaro.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 02, 2021 at 06:30:06PM +0800, Leo Yan wrote: > Use WRITE_ONCE() for updating aux_tail, so can avoid unexpected memory > behaviour. > > Signed-off-by: Leo Yan Acked-by: Peter Zijlstra (Intel) > --- > tools/perf/util/auxtrace.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h > index e625bc76cdde..abc4282f5272 100644 > --- a/tools/perf/util/auxtrace.h > +++ b/tools/perf/util/auxtrace.h > @@ -458,7 +458,7 @@ static inline void auxtrace_mmap__write_tail(struct auxtrace_mmap *mm, u64 tail) > > /* Ensure all reads are done before we write the tail out */ > smp_mb(); > - pc->aux_tail = tail; > + WRITE_ONCE(pc->aux_tail, tail); > } > > int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel