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.5 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 CF2F9C07E95 for ; Tue, 13 Jul 2021 12:58:03 +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 9F08F600D1 for ; Tue, 13 Jul 2021 12:58:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F08F600D1 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=8jGpYsFFMiJ7qjmCCmaW9WCwbx02xZ/fja2QKJmwsYU=; b=TgeYynx/lvda9G 0fz1fAPElv09LU7OotZYDo00zPhcUdR+r9C84P85ZDJyMCic98ueOegOTIGcEYx6h4ueIVmM6VQRn SwWF3ZYyH3GFi3tnYV8GcjzCJ0DrV1wpgLTNLxIzbUziD4tP3Mz571FZkUnRCctApIu0qBoue0288 c5g9mFKkcbhD79d3f1B39B+UeBEP8Vxm7z4nixF+6zdF8NNMGE9QRyQh647oJw0PXL/Hy/BPne6Yi jeBB/5I5wTbKnL8wJKPH31GY0UUff+Kb3c+9ktAIt5I+AWMVH1UKNEzLAaGaBzQ51sV09XOIk65mj UEFYiANRoH2WWwFqHP4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3HxZ-00AQh2-Su; Tue, 13 Jul 2021 12:56:26 +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 1m3HxW-00AQfp-Li for linux-arm-kernel@bombadil.infradead.org; Tue, 13 Jul 2021 12:56:22 +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=HYg+Gfy1rzeXrpFBUcY0k1dwItUMLKZvkbcYt//5vGs=; b=Ub9SgGnQKmt3zkIyJReBe/qE5m Yd92oP9f5SvHwpnoK2HskVaKdko2ZDkimitSCSIYLaHIHWEzAMZ+aeOEJlzF1QdA4VHXq0RGp0mHH TIRTgUioV6gth7Ip8RTWYDudTwc/uRewtHzzhSD1Slw4WhFlrF/+DvBLxoseR+flZRovW/Vgqg252 a5ShtUV1r4Zf8PNy3rABuMRHORrS/JLILcSTgSTZaZ58TclGfyfPVRB30ck9F/Bcw6cz7v1V2c7iO uceGGFmts7bMmDNuoJzbqYMsMZhjNFx0AjGzpezPP1oYxR2oWcSUFcoEyduUlQ28pBSnqVmqdqp4A lCPgpYbA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3HxG-00171O-Nc; Tue, 13 Jul 2021 12:56:08 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 566F7987782; Tue, 13 Jul 2021 14:56:06 +0200 (CEST) Date: Tue, 13 Jul 2021 14:56:06 +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 , 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 Subject: Re: [PATCH v4 03/11] coresight: tmc-etf: Add comment for store ordering Message-ID: <20210713125606.GB4170@worktop.programming.kicks-ass.net> References: <20210711104105.505728-1-leo.yan@linaro.org> <20210711104105.505728-4-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210711104105.505728-4-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 Sun, Jul 11, 2021 at 06:40:57PM +0800, Leo Yan wrote: > 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 > --- > drivers/hwtracing/coresight/coresight-tmc-etf.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > 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); 'more heavy' is not a correctness argument :-) The argument to make here is that CS_LOCK() ensures completion / visibility of the hardware buffer. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel