Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5369935pxu; Wed, 21 Oct 2020 23:43:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ2E5qm3CNU4Y3xIpIMfWL8ee79GLa7N1kq+LsQonJppgbTRPDNGw0AEx1wZqWe10RlJtz X-Received: by 2002:aa7:c815:: with SMTP id a21mr882781edt.166.1603349019822; Wed, 21 Oct 2020 23:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603349019; cv=none; d=google.com; s=arc-20160816; b=TL0cI+CAUKkGqkgw27ys0l2ZqYYPI2voAxh/RJjROrBb8t29vR506dTB4LuvpqfPhZ hL66B3FZToBnNwbwKjcaF2u7BbiFWmD70ntqExQDT5hqPd4wsWAEEWGDrYzfEgsFu7M2 /55zULL1s77ehfIEYLqhl4idhbtTDeK5i0X/qZCyAzKsCctwJqIgoJ23nplf+uOK9gNY a0si+ufoJObJZBRWciCiKJVJvkPdpQ6hBRIhOm4U9JL8rMgi8jfGyPUI6t1q4DDeB44n JHoECwtYk6Vt9JSKkCUh9akXwe/1QhD5eawoSReNqQmKFH2aB27TNigZIySfCsYixTuO uEuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=d+FTFruQjrTJWZ4Ir+gO6y2Do6AyjddNvQAex+YXbjw=; b=MINto2blRJQRJ6OJPkFSs74uYEmpP7zLz9fUyi2YIEJn+4xaYzQEft4rZZe/wgEfyg UGmgx6tlnA2vFWpy4NhZokFUL6UTujGY8yg+1Hm1GrMRrmrQoD4qBsuB/cauFS9waQtm zUlQR1HyWUTHrtm46DOiO95z30gApuj+00gXR+Rs/CSf2Aw/QNbREJWh9Yr8dOMYWnsW x/djYGBZeHXm0XyrDz4fw9ebyX2F0h19cd8PyjT3lmT+lPUCvIc/EcP/0Iii0Dw8lnRv mExnme0i4mcaYWoYCR35xQ7a3W0s6AL1TYT4YT1FFx7dU4cHUKyInRCVNj5NjjybXzgw GezA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp17si293070ejc.524.2020.10.21.23.43.18; Wed, 21 Oct 2020 23:43:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2442087AbgJUT2Z (ORCPT + 99 others); Wed, 21 Oct 2020 15:28:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:52816 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2411191AbgJUT2Z (ORCPT ); Wed, 21 Oct 2020 15:28:25 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 48D6CAE55; Wed, 21 Oct 2020 19:28:24 +0000 (UTC) From: Davidlohr Bueso To: peterz@infradead.org Cc: tglx@linutronix.de, mingo@kernel.org, a.darwish@linutronix.de, dave@stgolabs.net, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: [PATCH] timekeeping: Convert jiffies_seq to seqcount_raw_spinlock_t Date: Wed, 21 Oct 2020 12:07:49 -0700 Message-Id: <20201021190749.19363-1-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new api and associate the seqcounter to the jiffies_lock enabling lockdep support - although for this particular case the write-side locking and non-preemptibility are quite obvious. Signed-off-by: Davidlohr Bueso --- kernel/time/jiffies.c | 3 ++- kernel/time/timekeeping.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index eddcf4970444..a5cffe2a1770 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c @@ -59,7 +59,8 @@ static struct clocksource clocksource_jiffies = { }; __cacheline_aligned_in_smp DEFINE_RAW_SPINLOCK(jiffies_lock); -__cacheline_aligned_in_smp seqcount_t jiffies_seq; +__cacheline_aligned_in_smp seqcount_raw_spinlock_t jiffies_seq = + SEQCNT_RAW_SPINLOCK_ZERO(jiffies_seq, &jiffies_lock); #if (BITS_PER_LONG < 64) u64 get_jiffies_64(void) diff --git a/kernel/time/timekeeping.h b/kernel/time/timekeeping.h index 099737f6f10c..6c2cbd9ef999 100644 --- a/kernel/time/timekeeping.h +++ b/kernel/time/timekeeping.h @@ -26,7 +26,7 @@ extern void do_timer(unsigned long ticks); extern void update_wall_time(void); extern raw_spinlock_t jiffies_lock; -extern seqcount_t jiffies_seq; +extern seqcount_raw_spinlock_t jiffies_seq; #define CS_NAME_LEN 32 -- 2.26.2