Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp371934pxa; Thu, 27 Aug 2020 04:55:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoaIeQPKcsS/FfzJKf84/z0WQK3InnDg72BMT2OOlE9PJWHEDqVN83W8bnH8WTqqQQ6+OM X-Received: by 2002:aa7:d68f:: with SMTP id d15mr2613280edr.69.1598529325910; Thu, 27 Aug 2020 04:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598529325; cv=none; d=google.com; s=arc-20160816; b=ivHAt+BNN2jRp8me4HKZKZTpl3d9hZo5/AX8jG79hAOtb3fTe4GQfTavZjyuYJbiPE 1Gi4WCttAoT3zMddZimg3yq7nXyVjwATPJMnRbT+khXSBTHVUN82AH3Wybj4JPnRuOIw QEaydMlompGo7d1YGhY8M7PbiXxQRdxpwLHHhJ3R3HDtlDGBOtro0tkaN5QE35F3DFhs gbAEu2YpmcdX/a+8g5AIIDDy0j2GVXwArzasbP8VWy8jATKnbcrv3crbM7WVarbZbtnC +YmlA/dQY3YhMUzbVQ/1PoHYLZ96Oze6pKtV4SB5W9QtwZ+PIxj4oeD+8zROc9VEMgVP lmgw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=SII/dzF1qlKGKAwSghzgCWyB6lBajZKPLa5gJMm1iAY=; b=FDaKHjvYYdxovr8BuM7Fe0zmh+Gt+xsFox+MitmZn/zKagYij4BTDH2oW3qnumOLlY tJHR3IMlmjTt7vngP192DOFnwnP/a9RxunJSfBGnvD0jDfLgqvzjNFgOfhTAsvR5mzbD 6SGDrhYxMCV6eqSNOrIPpsSPHjUUpf+4go/6ndqCcRBS/Vb3Hs66rPzwbrOGLTYuaToK WbDHusqAyYVwm/jH7scuhsYOAyajwuNytyDwsyyWpju9479x6JkNjnKasIuLurVIFhxG wbfpjoN1zJvrRpvCLWoqOfSz08D3BVfV0kKFZg8MkXzsjANO2yV+1Ps+sgdOjlHLRrsO mSXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="1lu/7OLC"; dkim=neutral (no key) header.i=@vger.kernel.org; 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=pass (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 f9si1378407edm.167.2020.08.27.04.55.03; Thu, 27 Aug 2020 04:55:25 -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=pass header.i=@linutronix.de header.s=2020 header.b="1lu/7OLC"; dkim=neutral (no key) header.i=@vger.kernel.org; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728962AbgH0Lxz (ORCPT + 99 others); Thu, 27 Aug 2020 07:53:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728795AbgH0Lkq (ORCPT ); Thu, 27 Aug 2020 07:40:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF5A5C06121B for ; Thu, 27 Aug 2020 04:40:45 -0700 (PDT) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598528444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SII/dzF1qlKGKAwSghzgCWyB6lBajZKPLa5gJMm1iAY=; b=1lu/7OLCK0kilASSqPn1E+QXo7wFk+3ChXTuz+wV8mkJyTUo4ank67jU48ACRdrD95avVm Jaiu+dnpXLqbhKUFZpbnDuXSQV8ZMkVFTFPBHWmNNgeZ0f9MiWIRCIfS+9AqZEAx+R6Og1 c+X4E1TLxmqwzJf5evz6ptqHBg1a19oK2enR6qU/B+cV2tMi1uZg+I+LNLbV1khZxrjrsq B67zcngZIezMcEur+R3PMa/q3JPKMUCWL+ArnssYjgto7q7iLqzPIZiMrcUofqASBoKZny 0UYOmmBro3VjiC0O5GuF2J0mRGZDTTG93pEHrKhSjJhZ/nXMcDOB8kRJmk/+Ng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598528444; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SII/dzF1qlKGKAwSghzgCWyB6lBajZKPLa5gJMm1iAY=; b=PpqpVRFFaDPy3f6CfDdY7JLmLjwrM6f+3qzh1S8ihZ3MzDF/99E0pPpvzLrpx0Bn4LLJpn lIWEn4dZoSSd/XAA== To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Thomas Gleixner , "Sebastian A. Siewior" , LKML , "Ahmed S. Darwish" Subject: [PATCH v1 4/8] time/sched_clock: Use seqcount_latch_t Date: Thu, 27 Aug 2020 13:40:40 +0200 Message-Id: <20200827114044.11173-5-a.darwish@linutronix.de> In-Reply-To: <20200827114044.11173-1-a.darwish@linutronix.de> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200827114044.11173-1-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 8c6b5febd7a0..0642013dace4 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) -- 2.28.0