From patchwork Sun Jul 4 07:16:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12357239 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=-18.2 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,URIBL_BLOCKED, USER_AGENT_GIT 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 9A407C07E95 for ; Sun, 4 Jul 2021 07:21:24 +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 68FA26192E for ; Sun, 4 Jul 2021 07:21:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68FA26192E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k3SmVjbd8gvDJHCjf4gxo8VP8YpfgI9kB7pDsGXVIBo=; b=Ugyk9Raq2DrsfV rD7hSQEt1F6R7E4g6Z30MGgaSvbStOU9PIDtCa/h6ePPnhwCjGD6XprYiDncIiwMYWnxGojmR7BEr QkVtduxSKxNQynPV/Gd/5IIO6RmSKLp7m0v/loWuk39P3tLjdgxasFotIZdLdY35xO48l8eDrRQfY Yskcmnvfgyph7M1RlpF7sHHuYolbI/pc5msx8wrJjTao4PWZmAbMD4HWZs1xHWDHJJusq98EVm4jX EUP241aYJdz9cDAtijpmwDo4r+vB6dk89D4y4lBitdGSop5H9rZhfktr0+8zWYPWtq8HB7B6PjjaF 59BLW4YRL54SEoz3W0LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwPA-005rvg-0k; Sun, 04 Jul 2021 07:19:04 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwNf-005rRb-UM for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 07:17:34 +0000 Received: by mail-pf1-x433.google.com with SMTP id w22so9907106pff.5 for ; Sun, 04 Jul 2021 00:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kCQzQNUYho/r8d2unDfjM9CEfsvPEczKr8vsttMJnd8=; b=pGJGBIEcKP1v98r9fkfW8D3gn5kEVOQ2tcNe7vRZ9woJExO1ntTVeLbMgMtMwJ1UYg CZcI1vzj+wtUb8hHrRiEko7miZUZ4Hv3O5iCFse4PI6SKhVNasQ772ZJKMcgUSp5HFho 1WuvnbPOS0pqZ4VpvHcChWEZPKNGxYsjIhbK4z1uho/+T3OKZMmuV0t3MqQ1zhJ5Fe4L WRlYFSFx2psp9RZIkPWM957bfv2tQASWkYo3PFNYkVYK1AouAEHx2swR7X4paGZbWEGZ wr8j1xjQoKMA+TkSyc+DfS4cI30Szw2nUfVC7EnoQLFpqvZKIovexoBgd+obHTjzgCJN YjPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kCQzQNUYho/r8d2unDfjM9CEfsvPEczKr8vsttMJnd8=; b=tvydmu1FqReEDDut2011vNhpEQCMj37NLLRhOEDagXMrzK78q9r9TFhE2ULKYez9g2 vGsaFx0tRUWFLwJfCyBY7oaRd5Fcu9XmM4Jm7lXTt4TOmAEkFqsiQ8eRtpFrGKlV08Zl cx2J3sf3DMGUUNOlnxN+ju/vIIqJPa1Sf0HGwe2tRYMVa2/ISwv9kZOpqTB4laQ/6Aos KcwJkp3vZPqUakSpO+P5N7+VfggD9K9GAApDILxzj+7UVuBHfon9Wznp7591tJPtCX3Q cqI8xfChJmOef+gjOOal/AzegJPQaKB1O930Lwwx+AG7tyy82nDNegnZrLtQvT/RkNIH BjfQ== X-Gm-Message-State: AOAM532bWQOjiTbyeZAZhRu9ARFS6PXCGObqG/bGGqwY/ZX0mVcpWZYo UPn+ykEk/IniCEwphVJ8PJOJJA== X-Google-Smtp-Source: ABdhPJy/0lUUGEPuTONMJGU3vs7xq5nWAKNr4/oXiN3xxNG/2XrE5GcCMZpOwGHpAVm/Oh7WcB7i1g== X-Received: by 2002:a05:6a00:13a7:b029:309:bfd1:a3f5 with SMTP id t39-20020a056a0013a7b0290309bfd1a3f5mr8464357pfg.66.1625383051124; Sun, 04 Jul 2021 00:17:31 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id m24sm3092470pgd.60.2021.07.04.00.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 00:17:30 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Adrian Hunter , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Suzuki K Poulose , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v3 08/10] perf auxtrace: Use WRITE_ONCE() for updating aux_tail Date: Sun, 4 Jul 2021 15:16:42 +0800 Message-Id: <20210704071644.107397-9-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210704071644.107397-1-leo.yan@linaro.org> References: <20210704071644.107397-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_001732_029189_020EFE6F X-CRM114-Status: GOOD ( 14.32 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use WRITE_ONCE() for updating aux_tail, so can avoid unexpected memory behaviour. Signed-off-by: Leo Yan Acked-by: Adrian Hunter 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 1a2f42980e3f..d68a5e80b217 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -456,7 +456,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,