public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: manty kuma <mantykuma@gmail.com>, linux-rt-users@vger.kernel.org
Subject: Re: Questions related to nano_sleep()/hrtimer
Date: Thu, 08 Jul 2021 15:29:26 +0200	[thread overview]
Message-ID: <87czrtorwp.ffs@nanos.tec.linutronix.de> (raw)
In-Reply-To: <CAB6A5-C=YsVca4OQJZ=tOg9mjzEjobD9b94Mkvc0Ora_uQ-GCA@mail.gmail.com>

Manty,

On Tue, Jun 29 2021 at 13:54, manty kuma wrote:
> - What is the clock source for HRTimers and what is the frequency of
> this clock device?

Depends on your hardware.

> - with timer subsystem CONFIG_HZ can go to a max of 1000 meaning at
> the maximum only 1 ms latency can be reliably established. I
> understand that hrtimers are not using CONFIG_HZ but i am just curious
> as to what their clock source is and how 1 ns precision is achieved?

1ns is the theoretical precision and depending on the frequency of the
clock source (for reading the time) and the frequency of the clock event
device (for arming the next event) the resulting precision might be >
1ns, but all calculations are at the 1ns level.

> - I am using a RT kernel and I see that interrupt handlers are
> executed as threaded-irqs. Is it possible to configure the priority of
> the interrupt handler hrtimer_interrupt()? for a FF process, the

The timer interrupt which ends up in hrtimer_interrupt() is never
threaded.

> wakeup() is called from interrupt context(called by threaded irq)

I seriously doubt that. If at all then the wakeup() happens from
ksoftirqd().

> which is actually having lesser priority than my higher priority
> process. If possible I would like to change the priority of the
> threaded_irq  process that handles timer interrupts. I believe this
> way sleep() will not take longer than expected.(I am debugging issues
> where even my FF process with prio 110 sometimes fails to wake up back
> in time)

Prio 110? FIFO maximum priority for user space is 99.

If you talk about the kernel internal priority view, then 110 is _not_
FIFO.

Thanks,

        tglx

  parent reply	other threads:[~2021-07-08 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  4:54 Questions related to nano_sleep()/hrtimer manty kuma
2021-06-29 19:15 ` Chris Friesen
2021-07-08 13:29 ` Thomas Gleixner [this message]
2022-05-12  3:39   ` high latency introduced by hrtimer_interrupt yosi yarchi

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=87czrtorwp.ffs@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mantykuma@gmail.com \
    /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