From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 334CE38F226 for ; Mon, 25 May 2026 13:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779717566; cv=none; b=bCIybs8M83MK6Bwb9khsjEWZEKAsHtrvTF57/7FQEgORSnzzvw9iQGAap/H6X3M96bUFhctUpHMJIeceDVAHpf4JNlpTofrsonafymCxeBd8Wb1KUsYhXgr3c/PbsChj/kUFSwVmxHFzfl3LROjJ6OFuBcW1j5ncPUJQiWR3ApA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779717566; c=relaxed/simple; bh=vc+e7V00gwoKxn4OFAlN3GWqF8P8cAniiqmQFkOUzEQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nvYCT4CxxxG/h1tpPEUoVSjvwN6l2CWrcNtHccP6nu43Hx+ItmdDPn2qgEVghxGnk4cJWA/a8C/0yHhRGLyzPOXRStuUAYzUM40cuQDRZmoH/Qtw7EEvE+n/G19rIBtfZwyNezBdV39CjOFGZwG13fwPX+26yEJikU7DfM3lK78= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=casper.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=KiU6q1o/; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=casper.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="KiU6q1o/" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=0r/pLZwrX+mj1wjtsqI+lYHgSVd1l0kXfa8s67RNoPY=; b=KiU6q1o/tZL51ePM5nWLfJrEBR lmGoJ377XijzboJSmrCr8Frjc3TAymsP4eHxMAn77Dp61aMcHwdvLYyidP15+ZJL+CkzWZ/DsXoxF rAthYylQRDnXAFIlMb/r+rr5ns87XNTXimnaDFqUq4YULfbhjngbnFXumpgJZSZQTe2uxRuXvGKlv YISe5lnVY35DpUWVHsiLtfpMQToTSFCzUCdmBtjpCclJCKz52jeWRlFdcAPTXO5HEVNp5D0j7cT6e j2nGX6HxxtVQe9Z6dJxk+xScYPPYfNMtYhprdYmIJwMSOt+WU0oqulPimt/e5xEoUjqXz+TbjJQVe EzwU9MKw==; Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wRVpk-0000000HBAT-039j; Mon, 25 May 2026 13:59:09 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.2 #2 (Red Hat Linux)) id 1wRVpj-00000000Wry-2uXx; Mon, 25 May 2026 14:59:07 +0100 From: David Woodhouse To: Richard Cochran , Wen Gu , David Woodhouse , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Stultz , Thomas Gleixner , Stephen Boyd , Anna-Maria Behnsen , Frederic Weisbecker , Shuah Khan , Peter Zijlstra , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Arnd Bergmann , Miroslav Lichvar , Julien Ridoux , Ryan Luu , linux-kernel@vger.kernel.org Subject: [PATCH v4 7/7] ntp: Remove tick_length_base, use tick_length directly Date: Mon, 25 May 2026 14:54:39 +0100 Message-ID: <20260525135904.126282-8-dwmw2@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260525135904.126282-1-dwmw2@infradead.org> References: <20260525135904.126282-1-dwmw2@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html From: David Woodhouse Now that nothing inflates tick_length beyond tick_length_base (the adjtime path was converted to use time_offset in the previous commit), the two fields are always equal. Remove tick_length_base and keep tick_length as the single field. Remove the per-second reset and the delta update in ntp_update_frequency() since there is no separate base to track. No functional change intended. Signed-off-by: David Woodhouse Assisted-by: Kiro:claude-opus-4.6-1m --- kernel/time/ntp.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 9470ac1f597b..2aada891aead 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -26,8 +26,7 @@ /** * struct ntp_data - Structure holding all NTP related state * @tick_usec: USER_HZ period in microseconds - * @tick_length: Adjusted tick length - * @tick_length_base: Base value for @tick_length + * @tick_length: Tick length in ns << NTP_SCALE_SHIFT * @time_state: State of the clock synchronization * @time_status: Clock status bits * @time_offset: Time adjustment in nanoseconds @@ -59,7 +58,6 @@ struct ntp_data { unsigned long tick_usec; u64 tick_length; - u64 tick_length_base; int time_state; int time_status; s64 time_offset; @@ -246,8 +244,7 @@ static inline void pps_fill_timex(struct ntp_data *ntpdata, struct __kernel_time #endif /* CONFIG_NTP_PPS */ /* - * Update tick_length and tick_length_base, based on tick_usec, ntp_tick_adj and - * time_freq: + * Update tick_length based on tick_usec, ntp_tick_adj and time_freq: */ static void ntp_update_frequency(struct ntp_data *ntpdata) { @@ -264,8 +261,7 @@ static void ntp_update_frequency(struct ntp_data *ntpdata) * Don't wait for the next second_overflow, apply the change to the * tick length immediately: */ - ntpdata->tick_length += new_base - ntpdata->tick_length_base; - ntpdata->tick_length_base = new_base; + ntpdata->tick_length = new_base; } static inline s64 ntp_update_offset_fll(struct ntp_data *ntpdata, s64 offset64, long secs) @@ -342,7 +338,6 @@ static void __ntp_clear(struct ntp_data *ntpdata) ntp_update_frequency(ntpdata); - ntpdata->tick_length = ntpdata->tick_length_base; ntpdata->time_offset = 0; ntpdata->ntp_next_leap_sec = TIME64_MAX; @@ -502,7 +497,6 @@ int second_overflow(unsigned int tkid, time64_t secs) } /* Compute the phase adjustment for the next second */ - ntpdata->tick_length = ntpdata->tick_length_base; /* * Set the per-tick skew rate for the tick code. This is in the -- 2.54.0