From: David Laight <david.laight.linux@gmail.com>
To: Michael Byczkowski <by@by-online.de>
Cc: Rodolfo Giometti <giometti@enneenne.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] pps: pps-gpio: split IRQ handler into hardirq and threaded parts
Date: Thu, 9 Apr 2026 19:52:41 +0100 [thread overview]
Message-ID: <20260409195241.3fe354a2@pumpkin> (raw)
In-Reply-To: <44669820-2D7D-44BF-B518-583B672946F4@by-online.de>
On Thu, 9 Apr 2026 17:27:21 +0200
Michael Byczkowski <by@by-online.de> wrote:
> On PREEMPT_RT, all IRQ handlers are force-threaded. The current
> pps_gpio_irq_handler captures the PPS timestamp via pps_get_ts()
> inside the handler, but on RT this runs in thread context — after
> a scheduling delay that adds variable latency (jitter) to the
> timestamp.
>
> Split the handler into a hardirq primary (pps_gpio_irq_hardirq)
> that only captures the timestamp, and a threaded handler
> (pps_gpio_irq_thread) that processes the event. With
> request_threaded_irq(), the primary handler runs in hardirq context
> even on PREEMPT_RT, preserving nanosecond timestamp precision.
What happens if the threaded irq handler doesn't run until after
the next (or more than one) hard irq?
Threaded irq really don't work well for timer interrupts at all.
They end up like buses - none come for ages and then they all
arrive at once.
David
>
> On non-RT kernels, request_threaded_irq with an explicit primary
> handler behaves identically to the previous request_irq call.
prev parent reply other threads:[~2026-04-09 18:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 15:26 [PATCH v3 0/3] pps: improve PREEMPT_RT performance Michael Byczkowski
2026-04-09 15:27 ` [PATCH v3 1/3] pps: pps-gpio: split IRQ handler into hardirq and threaded parts Michael Byczkowski
2026-04-09 15:28 ` [PATCH v3 2/3] pps: convert pps_device lock to raw_spinlock for PREEMPT_RT Michael Byczkowski
2026-04-09 15:29 ` [PATCH v3 3/3] pps: convert pps_kc_hardpps_lock " Michael Byczkowski
2026-04-09 18:52 ` David Laight [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=20260409195241.3fe354a2@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=by@by-online.de \
--cc=giometti@enneenne.com \
--cc=linux-kernel@vger.kernel.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