mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qais Yousef <qyousef@layalina.io>
To: Saravana Kannan <saravanak@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Stultz <jstultz@google.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Kconfig.hz: Change default HZ to 1000
Date: Sun, 16 Feb 2025 16:29:14 +0000	[thread overview]
Message-ID: <20250216162914.n74bcclvry7cwvnh@airbuntu> (raw)
In-Reply-To: <CAGETcx9T-Fz-AN0GgOCmT+xZ3JMehmz-cDf5wEm7a1QuBHWUxA@mail.gmail.com>

On 02/13/25 00:24, Saravana Kannan wrote:

> >  kernel/Kconfig.hz | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/Kconfig.hz b/kernel/Kconfig.hz
> > index 38ef6d06888e..c742c9298af3 100644
> > --- a/kernel/Kconfig.hz
> > +++ b/kernel/Kconfig.hz
> > @@ -5,7 +5,7 @@
> >
> >  choice
> >         prompt "Timer frequency"
> > -       default HZ_250
> > +       default HZ_1000
> 
> This is going to mess up power for tons of IOT and low power devices.

Why are you singling them out? Why is it worse for them compared to other
battery powered devices?

> I think we should leave the default alone and set the config in the
> device specific defconfig. Even on Android, for some use cases, this

I'll hold the mirror and tell you to keep the default for your systems in your
defconfigs. There has been a lot of discussion about sched latency and this is
a common cause especially when combined with schedutil. There's a lot of
accidental behaviors going and they are being addressed. The default should be
representative of what users of all classes are after. And responsiveness has
been a prime problem for a while.

> causes ~7% CPU power increase. This also causes more CPU wakeups

Have you analyzed the cause? Is this caused by something not mentioned in the
commit message? Accidental behaviors are not a reason not to move on to better
default. And managing system response time (particularly with schedutil) is an
ongoing area of improvement.

UiBench gets 13% and 54% less missed frames at the cost of 6.67% higher power.
There's a big performance impact because of the long TICK.

Phoronix (thankfully!) did a comparison too. The power impact wasn't noticeable
with some big gains in some benchmark. The things that got slightly worse were
regained by enabling PREEMPT_LAZY according to the comments.

	https://www.phoronix.com/news/Linux-250Hz-1000Hz-Kernel-2025

> because jiffy based timers that are set for t + 1ms, t + 2ms, t+ 3ms,
> t + 4ms would all get grouped into a t + 4ms HZ wakeup, but with 1000
> HZ timer, it'd cause 4 separate wakeups.

This has been called out in the commit message. You can't rely on accidental
behavior. If this is something that you think matters a lot you can send
a patch to do this coaleasing and decouple it from TICK. The right thing to do
is audit the drivers that are causing high wake rate. You can't prevent
improvements to the system because there are users that rely on wrong behavior.

> 
> I'd like to Nack this.

Please use the value you like in your defconfig if you have concerns. The new
default is a good indications for what people should be using by default. But
no one is forcing anyone to stick to them. The new default is what really the
majority of people want today, and this patch signals this clearly but doesn't
take away any other option from them.

--
Qais Yousef

  reply	other threads:[~2025-02-16 16:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10  0:19 Qais Yousef
2025-02-12 14:50 ` Joel Fernandes
2025-02-16 16:11   ` Qais Yousef
2025-02-23  7:50   ` Andrea Righi
2025-02-23 10:00     ` Ingo Molnar
2025-02-23 23:21       ` Qais Yousef
2025-02-24 13:16         ` Vincent Guittot
2025-02-24 23:23       ` Sean Christopherson
2025-02-13  8:24 ` Saravana Kannan
2025-02-16 16:29   ` Qais Yousef [this message]
2025-02-16 19:05 ` David Laight
2025-02-22 23:47   ` Qais Yousef
2025-02-28 10:33 ` Attila Fazekas
2025-03-02 12:05   ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250216162914.n74bcclvry7cwvnh@airbuntu \
    --to=qyousef@layalina.io \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=saravanak@google.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®