Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1324619pxk; Thu, 10 Sep 2020 12:31:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMKbJA0nTZaZN8oJ0xLZyZflj3r5ZuTexpG0d//rOmZWB8xwrPtcsn4YZJCRO7zhX0VbCA X-Received: by 2002:a17:906:48d6:: with SMTP id d22mr10738291ejt.462.1599766307853; Thu, 10 Sep 2020 12:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599766307; cv=none; d=google.com; s=arc-20160816; b=K4aKpzveR2EAPNNZMD8hNzj7fNf1FRHCfUPG8Z14uoAzdW+6TksBI40KylcUjNanbm lXTfOcvEGaZa92bkG+6gPDjOgzB/ivj28nO9ZtStGv6GnWjAoPWben8HU/jN9Ds75NyB 9CMWeRoi5/upjn10EVO9mBX2d1GDKGcgbSmVUIWGhr+cxWwvfMe16ycx6/7LR/4UFnh6 n0Q3xKCZfRzPfMl/L3qBR71VwjpIb5jhJl89tH3yPSclw1/SdWGwRqJa64rd0nwIHWcc 7YQ1Vn8gAdLonlkmOaOQN4p4S/YLeFoEgMiCMWH2YrfvYdH6BbJ0sRza1yOuS3DQc5PW YP7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=Z2/hUdQLd7wur+pFlosSdnnkNuhfnbkcRAyfZezhqDs=; b=nwe4//yB5CL6KHoY7fWYF/3m9bau1vXeFHuy7aFi5lfiJJMYRmPwJThco/eEskzGxF pDY2ifPCyvD842Hzl177gyej7pDKRuX0ABzeKAsW/iLTxts5bESJm/Sg/8XZcatELwYk TUx1/mKrdd2TAjmUh/yagJprHjctd2SEvaIGhUroeBYcWMLO31AFBkiCYuTQAAIYMKep RhYrhy/z80BfsQ+jilSkzWwBaTXpvdwDKi6WMucMWFqvf+g+EpuHKpjsDHlPggRaXWDY YU7QfxI19fL75QnzJgb/bxvRj4vbbsVfdBNB0OLH6wB05k9iyuTKTe0rbqd7sw7AkhyW 5xPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=s+zIzTOK; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qt23si4153967ejb.285.2020.09.10.12.31.24; Thu, 10 Sep 2020 12:31:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=s+zIzTOK; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727852AbgIJT2r (ORCPT + 99 others); Thu, 10 Sep 2020 15:28:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731222AbgIJPsR (ORCPT ); Thu, 10 Sep 2020 11:48:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31F8EC061358; Thu, 10 Sep 2020 08:08:30 -0700 (PDT) Date: Thu, 10 Sep 2020 15:08:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1599750508; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z2/hUdQLd7wur+pFlosSdnnkNuhfnbkcRAyfZezhqDs=; b=s+zIzTOKMTbUYLOVU9e4IE4wGdaXSk7tmLONJ7z/a+/EPs3XE7IZEMKR2TIRNRpDrgJE2o i6LPm0MQtTeQF76pfW1EeyC4AewS41eSQAzrVf7CY4PpNd+vu/+oqpTXzuD7jh+A8RPqAS 2PG705z705JxQfHYzpkghTugDtY0SD6EwOfML6OHPdw1G1t7TJSjuVCNWVuLvEO6EC2S57 u3Iohj1v6UwEeKUH6Zq3dgHnbiz8fiOgdh9Pe5lq6BL3PwSkWsj+Z2GHr1uI3Zt8ffe41o XCYIppNJwmqAkxmS9qTlQrzCEGsMkgRZFEB+fla6/i4F95+MX1HTFWoVdsisgg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1599750508; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z2/hUdQLd7wur+pFlosSdnnkNuhfnbkcRAyfZezhqDs=; b=Gz904nsajQPQrH0HFwvIoTp4fSM2h3IA/Ic84+ltv5fZjvhXp69CVc/q4tEtBJ+n4vuTfa UVcpzx6mJvDr+TBw== From: "tip-bot2 for Ahmed S. Darwish" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] time/sched_clock: Use seqcount_latch_t Cc: "Ahmed S. Darwish" , "Peter Zijlstra (Intel)" , x86 , LKML In-Reply-To: <20200827114044.11173-5-a.darwish@linutronix.de> References: <20200827114044.11173-5-a.darwish@linutronix.de> MIME-Version: 1.0 Message-ID: <159975050783.20229.16826459517712069243.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: a690ed07353ec45f056b0a6f87c23a12a59c030d Gitweb: https://git.kernel.org/tip/a690ed07353ec45f056b0a6f87c23a12a59c030d Author: Ahmed S. Darwish AuthorDate: Thu, 27 Aug 2020 13:40:40 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 10 Sep 2020 11:19:29 +02:00 time/sched_clock: Use seqcount_latch_t Latch sequence counters have unique read and write APIs, and thus seqcount_latch_t was recently introduced at seqlock.h. Use that new data type instead of plain seqcount_t. This adds the necessary type-safety and ensures only latching-safe seqcount APIs are to be used. Signed-off-by: Ahmed S. Darwish Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200827114044.11173-5-a.darwish@linutronix.de --- kernel/time/sched_clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 8c6b5fe..0642013 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -35,7 +35,7 @@ * into a single 64-byte cache line. */ struct clock_data { - seqcount_t seq; + seqcount_latch_t seq; struct clock_read_data read_data[2]; ktime_t wrap_kt; unsigned long rate; @@ -76,7 +76,7 @@ struct clock_read_data *sched_clock_read_begin(unsigned int *seq) int sched_clock_read_retry(unsigned int seq) { - return read_seqcount_retry(&cd.seq, seq); + return read_seqcount_latch_retry(&cd.seq, seq); } unsigned long long notrace sched_clock(void)