linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Michael Schanne <michael.schanne@gmail.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: liveloock using PREEMPT_RT with i915 driver
Date: Fri, 20 Jun 2025 10:16:52 +0200	[thread overview]
Message-ID: <20250620081652.gUUPOkOh@linutronix.de> (raw)
In-Reply-To: <CAC_kJhTQ635vwtj6c7UpvM3BwNb+baMASbeo8t2zT5m5UfEYHw@mail.gmail.com>

On 2025-06-19 07:19:23 [-0400], Michael Schanne wrote:
> > So you are not using clock_nanosleep() but something like a POSIX timer?
> 
> No, I was using timerfd_create() and then calling read() in a loop in
> my timer thread.  Is it recommended to use clock_nanosleep() instead?

clock_nanosleep() based delays allow a "direct" wakeup. So yes.

Because of how it is implemented, timerfd based wakeup need to be
performed by a thread which is ktimersd. If you busy-poll the timer from
your application then ktimersd needs to have a higher priority than your
application so that it can preempt it.
ktimersd is also responsible the wakeups of non-RT applications. So if
multiple SCHED_OTHER applications ask for a wakeup then this wake up
will preempt your realtime task.

> -Mike

Sebastian

      reply	other threads:[~2025-06-20  8:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  2:06 liveloock using PREEMPT_RT with i915 driver Michael Schanne
2025-06-17 10:05 ` Sebastian Andrzej Siewior
     [not found]   ` <CAC_kJhQZpZoUjavRsSVHuXL5k3-3u6+wdL9=h8Pbv3qWvzeOiw@mail.gmail.com>
2025-06-18 12:16     ` Sebastian Andrzej Siewior
2025-06-19 11:19       ` Michael Schanne
2025-06-20  8:16         ` Sebastian Andrzej Siewior [this message]

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=20250620081652.gUUPOkOh@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=michael.schanne@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;
as well as URLs for NNTP newsgroup(s).