From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 9F904198823 for ; Tue, 28 Jan 2025 09:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738055273; cv=none; b=m7bgqlkI6wVn6dZxNAXjfOXgOvMiJ2cNxx8vQJEUabubo9uKhT4QrU36d2iYZe64k89pQcUEzALN8hBOFuMbGAiyObYH27Ek1OIbwhrldkM2Ct13WG6bBDsdXURdUgyALiwED9padu2O+zx/2fe0+7C1+UOFD0YujPcnOOpd84c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738055273; c=relaxed/simple; bh=AATpZoiJgLHZsYbTM1uy3HlnwFT/ctbuqOFzsSPci7k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QjsSIJeHgcrTmhKSrPh7mYE3R18usi5lf9P+Adhgs6gVmHy5haC266QtkV5X/cTBg8uithkI5SZUzmGQsr8KrkYuk9sBgMUUiAX2L6OBiR85ENZePwFsSr+UlmJQQN3ssd8CQ1oRKy3UrOFPFjGlGdJmON8gCE/elweDo8TR8nE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=aFvq6Pa7; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="aFvq6Pa7" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9Bq3Ki5r8j7TNY9ZBOoNAW4UaIRzvq7A1hQRGmZqQbo=; b=aFvq6Pa7GWPvmBgDgiCjGdgM76 cUy93D0RZM3MD5r/An3Bw2fSfXad1V1f3TYzzTAztVnOaJb2/iTrdB+ok33FaCjFf02hLsRNICxD/ /eu7xdGt1mwhKWsVCQId+DQKfxn7t5Qv5CxUP3Y5BJim2bU8OK9OsFH4SbkrXFmRMJRnytIxEveOP /x6AB85GlPlrF8uLd2rvJMkP4iwdDs/sYkKgfKsQLcIqXiliUsdtD2oE57KD1gIilNlJs3uaLyBch Zi45nImfW3Z3+hXnAwO/YntQulewukxEGW0mS3Q+QJpgruRtuViHj/1i09Vedm+z5V2bxrDLu8fsI gsGR1bfw==; Received: from 77-249-17-89.cable.dynamic.v4.ziggo.nl ([77.249.17.89] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tchZK-0000000Esxr-2rfM; Tue, 28 Jan 2025 09:07:39 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id E8EC9300599; Tue, 28 Jan 2025 10:07:37 +0100 (CET) Date: Tue, 28 Jan 2025 10:07:37 +0100 From: Peter Zijlstra To: John Stultz Cc: LKML , Anna-Maria Behnsen , Frederic Weisbecker , Ingo Molnar , Thomas Gleixner , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Stephen Boyd , Yury Norov , Bitao Hu , Andrew Morton , kernel-team@android.com Subject: Re: [RFC][PATCH 2/3] time/tick: Introduce a dyn_hz boot option Message-ID: <20250128090737.GX7145@noisy.programming.kicks-ass.net> References: <20250128063301.3879317-1-jstultz@google.com> <20250128063301.3879317-3-jstultz@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250128063301.3879317-3-jstultz@google.com> On Mon, Jan 27, 2025 at 10:32:54PM -0800, John Stultz wrote: > Introduce dyn_hz= option, which allows the actual timer tick to > be scaled down at boot time. > > This allows kerenls to be built with HZ=1000 but systems to > effectively run as if HZ=100 if specified. > > The system will still run with the configured HZ value, but > ticks will just arrive "late". > > The valid values are between 100 and the build time CONFIG_HZ > value. > > Signed-off-by: John Stultz > --- > include/linux/tick.h | 11 +++++++++-- > kernel/Kconfig.hz | 9 +++++++++ > kernel/time/tick-common.c | 30 ++++++++++++++++++++++++++++++ > kernel/time/tick-sched.c | 4 ++-- > 4 files changed, 50 insertions(+), 4 deletions(-) > > diff --git a/include/linux/tick.h b/include/linux/tick.h > index b8ddc8e631a3c..734ee1e08c9ef 100644 > --- a/include/linux/tick.h > +++ b/include/linux/tick.h > @@ -14,6 +14,13 @@ > #include > #include > > +#ifdef CONFIG_DYN_HZ > +extern long long dyn_tick_nsec; > +#define DYN_TICK_NSEC (dyn_tick_nsec) > +#else > +#define DYN_TICK_NSEC TICK_NSEC > +#endif My git-grep TICK_NSEC spies a whole bunch of TICK_NSEC users that seem sad now. That is, why don't they all need updating?