Message ID | 20210704071644.107397-4-leo.yan@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=H7S8=L4=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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 5FF2FC07E96 for <linux-arm-kernel@archiver.kernel.org>; Sun, 4 Jul 2021 07:20:27 +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 316956192E for <linux-arm-kernel@archiver.kernel.org>; Sun, 4 Jul 2021 07:20:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 316956192E 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=VTIDxAXKVOF15iKPwM7JwRWuhlgvoW+b79dVI1gb3p8=; b=v4aZR8ukVWcmVn xbU8z6Iwbti9Xl8prmwZ5FkXBGtiQF5FxQXV5pRH4yZY9NaJL2iI4F6S6cG+PRSID26k4rAj1t5EZ 9btaGvoMO9dcyn1MqhhrBGcArE5vIBhhExS5TscoX3AMu9Ii4ffwxe4un4qTJn5vx3b369vnHiOUZ kYmIL399SI5yG4gLeubE+na5tAIrW31E79ksmhaO1Tp0joZRtjpU6h4JUoKhdsiu+XH69Ug4GyKyM doTl5HpwSaaasbywU46PrrD9jE9+qB4gv301auQAmWw0KG7C3+xrTrdV/kaM4Fvzpbk7fj22lE19O t10OBI8lCzNSID0WdLvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwNv-005rX8-4y; Sun, 04 Jul 2021 07:17:47 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwNQ-005rMj-3T for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 07:17:17 +0000 Received: by mail-pg1-x533.google.com with SMTP id u14so14889679pga.11 for <linux-arm-kernel@lists.infradead.org>; Sun, 04 Jul 2021 00:17:15 -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=MxgwZHP/NxGkiYvHiVeQZZDAd7piMTreovHUTu3tJE4=; b=F1Cm5HUe/W4qcO/YZMWcovyfhoTTd7gdBbhgFkxstFf0BT+ShATGv4q4OrsnJaIrpy G4hBHinkVsHh9Cfi4t7lXKwp5Oxp9ulth8gE3AIWRBetNA5chQJnCJiQvuemKUVHuRbe n0wOB5of97stC16+0L9Omkrn0PANT9WTrxCCu0YAkC2y8zgYlpDzcjMJCdW8dgPW9exy jJFzAoQSAkB35DvhbQtr8+GytWS5knvOXGvmCHZMucdYoV2PvCimYoGHVZxDSmDOZndZ LSQX4DwreOLmKwZYR3Nnikg/vk+UqtTmzHo34jmqqdyoIqKfxd2J+rzWJEchXwCUteoI NSnQ== 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=MxgwZHP/NxGkiYvHiVeQZZDAd7piMTreovHUTu3tJE4=; b=a6HVnfc7RXCXo4oFLzzTVMLQTZbkLXzC/9zdhvzdeflMQCwq93LpLWJgv7UPtvFUEJ SXtEnxTVYFeepegTOQlHxhtlatqJxCzAFAjRveU0o6ot+D04pk42FZxIdrnUPEn+vwLX 0rx776cmhU5i/R+NsQ1eaE0QGMyDdQMmvvzwOd9ahq9C9R9WbJ6avrwkfwzFRwdN1ar4 1EcIyXWqsdIm+xyTNxq06sl6aYKmOJo9H/5kuri65G1ia1drE8hID5kPexCm6enVMfIM zQP/dhDmnvQnTMIr/JnzSiQeoFDlSarBqumMTQ1ULLP4pfRahwbBu7/n/Md9apHCzDPK AZ1Q== X-Gm-Message-State: AOAM531MDF4ilC+imJhRy3gk6UNhFzVxsn8Q+B0n5xaRkvfbrwVqCGOf CdTRL0WkWxF88L0tgnHxq5kk2A== X-Google-Smtp-Source: ABdhPJxEg+L08YtRvHwbnJK9hTdwmsSSxA7M6/KGLxIa5RV8pIXUL0HVBWpIwu5ahxkZusKImzIv+Q== X-Received: by 2002:a65:62d8:: with SMTP id m24mr9309521pgv.150.1625383035208; Sun, 04 Jul 2021 00:17:15 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id la17sm6983974pjb.34.2021.07.04.00.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 00:17:14 -0700 (PDT) From: Leo Yan <leo.yan@linaro.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Adrian Hunter <adrian.hunter@intel.com>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Borislav Petkov <bp@alien8.de>, x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan <leo.yan@linaro.org> Subject: [PATCH v3 03/10] coresight: tmc-etf: Add comment for store ordering Date: Sun, 4 Jul 2021 15:16:37 +0800 Message-Id: <20210704071644.107397-4-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_001716_222085_9AA85D17 X-CRM114-Status: GOOD ( 14.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
perf: Refine barriers for AUX ring buffer
|
expand
|
diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 45b85edfc690..9a42ee689921 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -553,6 +553,12 @@ static unsigned long tmc_update_etf_buffer(struct coresight_device *csdev, if (buf->snapshot) handle->head += to_read; + /* + * AUX ring buffer requires to use memory barrier to separate the trace + * data store and aux_head store, because CS_LOCK() contains mb() which + * gives more heavy barrier than smp_wmb(), it's not necessary to + * explicitly invoke any barrier. + */ CS_LOCK(drvdata->base); out: spin_unlock_irqrestore(&drvdata->spinlock, flags);
AUX ring buffer is required to separate the data store and aux_head store, since the function CS_LOCK() has contained memory barrier mb(), mb() is a more conservative barrier than smp_wmb() on Arm32/Arm64, thus it's needless to add any explicit barrier anymore. Add comment to make clear for the barrier usage for ETF. Signed-off-by: Leo Yan <leo.yan@linaro.org> --- drivers/hwtracing/coresight/coresight-tmc-etf.c | 6 ++++++ 1 file changed, 6 insertions(+)