Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1323275pxk; Thu, 10 Sep 2020 12:29:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5Ej9oBBV0yNkiZd9DVvDaHTaMmTeqot/5kVkMs1CY35a29qcsZhPt5bkVq2p6nUjU/Lv/ X-Received: by 2002:a05:6402:1558:: with SMTP id p24mr10718769edx.194.1599766177298; Thu, 10 Sep 2020 12:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599766177; cv=none; d=google.com; s=arc-20160816; b=sIUWtcil8q+5Bag2ig+MXEde3IVGMpQUBpAj0WiDjqSx+k5e+wngXComDXsM+yNC6l 9uW/4ZRBbN/4Y0lbtu0tsW7WaGr2Dpt/qLjnloPV5w3N9NoUNo5cazEQ+qLgBxOIljpN w65S4FGC7jzUeFRDInEFLU8v6oWH4FdBFRCZrG/9xEb85ukQKqXqWHxfeu5oKq1Q+dE/ uuhmCNQMXg3p9LqjKs2z3/3SSwESnRaZzOlhjeGLjE7tLcOzNTmr5LTT0OhG60tY+les 6m/XdZ0a9WgsnaoJUPZaQpkFs77E/NEGYprgFWHLC1A94F3+nZM9CjjWbivgJYp4AAIU Sprg== 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=XBHuPonnkskzksJG6Zbiq3X3NoXaFg2IEQhNB0u44dk=; b=KK8rcpNUkSA9Lfip0QGyvNzOwE482Lmq1vS1cZfThPnFloMbaZCws4u8P5GIcvYd3c s2SQgQux11n6FYSoD21XU4wtTiRlf18TVUwf//7h4H/dKVE+s3jqUA41ewOfX8iY73PY p1bYkpzYMqpvjfdLzRgdDP4tfLBNd+NQeBsUXq53dv3Mb8DWWjOAv49uo/1VfEqKyg2u AU/aHGe5SjyzU0Ej67SkZ7Fbq5Sr4DWST7h0P6gD+1VUwRFIVa/nkqehhXTlvQn/XmK7 xLA2Ax2DyEy7kZJwF1XL0vQRyurFCgk4+0ue67Oy3e7Q3NNqcLel+YMHQ1FN6Ff86Kbg jYYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=1zpVDFbw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="sqP/Yqno"; 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 y16si4913024edq.199.2020.09.10.12.29.14; Thu, 10 Sep 2020 12:29:37 -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=1zpVDFbw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="sqP/Yqno"; 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 S1727032AbgIJT2g (ORCPT + 99 others); Thu, 10 Sep 2020 15:28:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731382AbgIJPsR (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 8FD95C06135A; Thu, 10 Sep 2020 08:08:31 -0700 (PDT) Date: Thu, 10 Sep 2020 15:08:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1599750509; 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=XBHuPonnkskzksJG6Zbiq3X3NoXaFg2IEQhNB0u44dk=; b=1zpVDFbwqSwixWiiVhhZI9t3RrgtIOywgCrOxNBfeviKrWTWsk1jo6mADVIvSTplGNbU9i YbfwDnfAmBbGPgvOMQ8c3ntupfkKGofT+SQY08GD1kwj20aKt+cU1JCVX39+N9lHSdAKHW 1QBvQSfUnPSacb1eBGmVlGw8H7ld7FMbuYJX5CbjRziSKm4p9Mri1fcG8SgbFga4ZC3c18 3bgiEu1jqmwRZVT2a0qup6Ry5VF1RWG6JC8X1lrQzFmKdfODKTA0nfzWNWDaOsiFxz39N2 0m2GK+YK3EBh6TT2zqzqkFA+S/KeIfr/f54EfQ9nItMrb+maWfoX0NFu1xbMEA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1599750509; 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=XBHuPonnkskzksJG6Zbiq3X3NoXaFg2IEQhNB0u44dk=; b=sqP/YqnopEtz6aJO018G34feZX0oIUi8GTM5XxcUh0qeuOv2gWFJcSn77AZlTuNSeUpK5u hRSjavqHqbSwnEAg== 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 raw_read_seqcount_latch() during suspend Cc: "Ahmed S. Darwish" , "Peter Zijlstra (Intel)" , x86 , LKML In-Reply-To: <20200715092345.GA231464@debian-buster-darwi.lab.linutronix.de> References: <20200715092345.GA231464@debian-buster-darwi.lab.linutronix.de> MIME-Version: 1.0 Message-ID: <159975050909.20229.15551175096840400557.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: 58faf20a086bd34f91983609e26eac3d5fe76be3 Gitweb: https://git.kernel.org/tip/58faf20a086bd34f91983609e26eac3d5fe76be3 Author: Ahmed S. Darwish AuthorDate: Thu, 27 Aug 2020 13:40:37 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 10 Sep 2020 11:19:28 +02:00 time/sched_clock: Use raw_read_seqcount_latch() during suspend sched_clock uses seqcount_t latching to switch between two storage places protected by the sequence counter. This allows it to have interruptible, NMI-safe, seqcount_t write side critical sections. Since 7fc26327b756 ("seqlock: Introduce raw_read_seqcount_latch()"), raw_read_seqcount_latch() became the standardized way for seqcount_t latch read paths. Due to the dependent load, it has one read memory barrier less than the currently used raw_read_seqcount() API. Use raw_read_seqcount_latch() for the suspend path. Commit aadd6e5caaac ("time/sched_clock: Use raw_read_seqcount_latch()") missed changing that instance of raw_read_seqcount(). References: 1809bfa44e10 ("timers, sched/clock: Avoid deadlock during read from NMI") Signed-off-by: Ahmed S. Darwish Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200715092345.GA231464@debian-buster-darwi.lab.linutronix.de --- kernel/time/sched_clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 1c03eec..8c6b5fe 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -258,7 +258,7 @@ void __init generic_sched_clock_init(void) */ static u64 notrace suspended_sched_clock_read(void) { - unsigned int seq = raw_read_seqcount(&cd.seq); + unsigned int seq = raw_read_seqcount_latch(&cd.seq); return cd.read_data[seq & 1].epoch_cyc; }