mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	Xuerui Wang <kernel@xen0n.name>,
	loongarch@lists.linux.dev, Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-rt-devel@lists.linux.dev, Guo Ren <guoren@kernel.org>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] LoongArch: Reduce min_delta for the arch clockevent device
Date: Thu, 14 Nov 2024 14:27:40 +0100	[thread overview]
Message-ID: <20241114132740.NuomQBEN@linutronix.de> (raw)
In-Reply-To: <CAAhV-H6vTBwi+t8cPKSo44KZKYj8ubwv2vV4FHrNH+nG=_ZXnw@mail.gmail.com>

On 2024-11-14 19:46:39 [+0800], Huacai Chen wrote:
> Hi, Sebastian,
Hi,

> On Thu, Nov 14, 2024 at 6:21 PM Sebastian Andrzej Siewior
> <bigeasy@linutronix.de> wrote:
> >
> > On 2024-11-08 17:15:43 [+0800], Huacai Chen wrote:
> > > Now the min_delta is 0x600 (1536) for LoongArch's constant clockevent
> > > device. For a 100MHz hardware timer this means ~15us. This is a little
> > > big, especially for PREEMPT_RT enabled kernels. So reduce it to 1000
> > > (we don't want too small values to affect performance).
> >
> > So this reduces it to 10us. Is anything lower than that bad performance
> > wise?
> Maybe I misunderstood the meaning of min_delta, but if I'm correct,
> small min_delta may cause more timers to be triggered, because timers
> are aligned by the granularity (min_delta). So I think min_delta
> affects performance.

They are not aligned. Well they get aligned due to the consequences.

In one-shot mode you program the device for the next timer to expire. It
computes the delta between expire-time and now. This delta is then
clamped between min & max delta. See clockevents_program_event().

This means if your timer is supposed to expire in 5us (from now) but
your min delta is set to 15us then the timer device will be programmed
to 15us from now. This is 10us after the expire time of your first
timer. Once the timer devices fires, it will expire all hrtimers which
expired at this point. This includes that timer, that should have fired
10us ago, plus everything else following in the 10us window.

> Huacai

Sebastian

  reply	other threads:[~2024-11-14 13:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08  9:15 [PATCH 0/3] LoongArch: Add PREEMPT_RT support Huacai Chen
2024-11-08  9:15 ` [PATCH 1/3] LoongArch: Reduce min_delta for the arch clockevent device Huacai Chen
2024-11-14 10:21   ` Sebastian Andrzej Siewior
2024-11-14 11:46     ` Huacai Chen
2024-11-14 13:27       ` Sebastian Andrzej Siewior [this message]
2024-11-15  6:44         ` Huacai Chen
2024-11-08  9:15 ` [PATCH 2/3] LoongArch: Select HAVE_POSIX_CPU_TIMERS_TASK_WORK Huacai Chen
2024-11-08  9:15 ` [PATCH 3/3] LoongArch: Allow to enable PREEMPT_RT Huacai Chen
2024-11-08 15:05   ` Steven Rostedt
2024-11-14 10:31   ` Sebastian Andrzej Siewior
2024-11-14 11:07     ` Huacai Chen
2024-11-14 11:14       ` Sebastian Andrzej Siewior
2024-11-14 11:19         ` Huacai Chen
2024-11-14 11:30           ` Sebastian Andrzej Siewior
2024-11-14 11:36             ` Huacai Chen
2024-11-14 13:29               ` Sebastian Andrzej Siewior
2024-11-14 14:43                 ` Clark Williams
2024-11-18  7:36                   ` Sebastian Andrzej Siewior
     [not found]                     ` <CAPAFJkp_MQ8rNsTTY3xfYMhdtiWQunN65Yfft1SqZLptG2J5cw@mail.gmail.com>
2024-11-20  7:36                       ` Sebastian Andrzej Siewior

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=20241114132740.NuomQBEN@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=clrkwllms@kernel.org \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=loongarch@lists.linux.dev \
    --cc=rostedt@goodmis.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

Powered by JetHome