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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 4851DC433E3 for ; Wed, 15 Jul 2020 07:45:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 191E02064C for ; Wed, 15 Jul 2020 07:45:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Kb22CJM3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EMD4enJk"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EOP6n3Wo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 191E02064C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=mL5sbWG3WSRr0NhHShswodSA++ZOPGVA2uFPd8MhO3I=; b=Kb22CJM3Fb8HZPeNql1zKkD4e PHHbALZSvjrP9yjgAxNThpaSjb7bOPSUdZXBWnjeH8AqLlXI4pq7mgih2SZKTMoV+K04JqqPYP+dw 4Fjk1xq3Mpqi3ZpcrI8FmYhz1E7/usS3cWJmA1PWiPzoF1d8NnC+OKl3/fyg7yK8lQLtO5xL4upQy uMZrirQo1LagvRaFdn0+x1kXDXgAbysZdme6zgVFUBSwjYuTr91rZLnZUR0mi7PYrUVvU2rKQF6N5 g5IWiHuAmck8AaKoQQ5EeHanx5fxqvH/C+AsOOuuJXIOG5aW2DtDa1urPL8XQjVT+uRtfQNhyP+iD y4Shms3Ow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvbjE-0002jH-6X; Wed, 15 Jul 2020 07:21:20 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvbjA-0002hB-A3 for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2020 07:21:17 +0000 Date: Wed, 15 Jul 2020 09:21:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594797674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LQKcsIDOp9awa5wYn/MiS0JSdtaDZAuKW8Y1r7Tzr58=; b=EMD4enJkqUiQpN/+EBNUOaxkp0MoHUOrBxYA0mA4w9LWfPjvCoYpqcHWBE/kg36etyHmfg 4pnUSyAfdwCs/LZN+Eu0lNJPKJbh4w7/hZKc/A+aHX9SCsGZr/oLWOl5l2twiTqcMW+rGX 7Do2G2sAsLjfX7wJ8fob5RL5X+jzdXKi4hkEIhUeTuAZCQrnPaI7GGv0PuYFcigUsn1G/j gQ2oLQuRbMhKH5rKa5KW7a6qnUFjzj2GFgcypCvCR5wg8jeI05KmZJ/HtjFhO29TGXpyC+ SfqbM/6BS99tlLwNIuy/w4GTXJTKRZbvGfe5IP0z+jzj4BUDtCo+gJHTW0jebQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594797674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LQKcsIDOp9awa5wYn/MiS0JSdtaDZAuKW8Y1r7Tzr58=; b=EOP6n3WooIDvd/2I0f/ZqKRcpxwz12l7P0dSD1vrkYd4039Yq0sz2gktohTSTQiE3slkaW 8CVrVCHbJH4HTZBw== From: "Ahmed S. Darwish" To: Leo Yan Subject: Re: [PATCH v2 1/6] sched_clock: Expose struct clock_read_data Message-ID: <20200715072112.GA231369@debian-buster-darwi.lab.linutronix.de> References: <20200715020512.20991-1-leo.yan@linaro.org> <20200715020512.20991-2-leo.yan@linaro.org> <20200715055650.GB225020@debian-buster-darwi.lab.linutronix.de> <20200715065407.GB19269@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200715065407.GB19269@leoy-ThinkPad-X240s> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200715_032116_529872_F6C37F3D X-CRM114-Status: GOOD ( 16.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Peter Zijlstra , Jiri Olsa , Adrian Hunter , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Paul Cercueil , Alexander Shishkin , Ingo Molnar , Catalin Marinas , Namhyung Kim , Thomas Gleixner , jogness@linutronix.de, Will Deacon , "Ben Dooks \(Codethink\)" , linux-arm-kernel@lists.infradead.org, Kan Liang 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, Jul 15, 2020 at 02:54:07PM +0800, Leo Yan wrote: > On Wed, Jul 15, 2020 at 07:56:50AM +0200, Ahmed S. Darwish wrote: > > On Wed, Jul 15, 2020 at 10:05:07AM +0800, Leo Yan wrote: > > > From: Peter Zijlstra > > > > > ... > > > > > > Provide struct clock_read_data and two (seqcount) helpers so that > > > architectures (arm64 in specific) can expose the numbers to userspace. > > > > > ... > > > > > > +struct clock_read_data *sched_clock_read_begin(unsigned int *seq) > > > +{ > > > + *seq = raw_read_seqcount(&cd.seq); > > > + return cd.read_data + (*seq & 1); > > > +} > > > + > > ... > > > > Hmm, this seqcount_t is actually a latch seqcount. I know the original > > code also used raw_read_seqcount(), but while at it, let's use the > > proper read API for seqcount_t latchers: raw_read_seqcount_latch(). > > Good point. To be honest, I think myself cannot give a good judgement > for memory barrier related thing :) > > I read a bit the document for the latch technique [1], comparing to > raw_read_seqcount_latch(), the function raw_read_seqcount() contains > smp_rmb(), IIUC, the *read* memory barrier is used to support for > kcsan. > The smp_rmb() has no relation whatsoever to KCSAN. It pairs with the write memory barriers in the seqcount_t write path. AFAIK, PeterZ is the author of this patch, so let's wait for his input here. Thanks, -- Ahmed S. Darwish Linutronix GmbH _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel