Re: [PATCH v5 0/3] pps: improve PREEMPT_RT performance
Calvin Owens <[email protected]> Tue, 19 May 2026 09:19:03 -0700
| Newsgroups | org.kernel.vger.linux-rt-users,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Saturday 05/16 at 13:32 +0200, Michael Byczkowski wrote: > > On 25. Apr 2026, at 19:18, Michael Byczkowski <[email protected]> wrote: > > > > I found three issues in the PPS subsystem that cause unnecessary jitter > > under PREEMPT_RT, while being fully backward-compatible with non-RT > > kernels: > > > > 1. pps-gpio: The IRQ handler is force-threaded on PREEMPT_RT, so the > > PPS timestamp is captured after scheduling delay rather than at > > interrupt entry. Fix: split into a hardirq primary handler (captures > > timestamp only) and a threaded handler (processes the event). > > > > 2. pps_device.lock: spinlock_t becomes a sleeping mutex on PREEMPT_RT, > > allowing pps_event() to be preempted mid-update. Fix: convert to > > raw_spinlock_t and move sleeping calls out of the critical section. > > > > 3. pps_kc_hardpps_lock: Same issue as (2), in the kernel consumer path > > that calls hardpps(). Fix: convert to DEFINE_RAW_SPINLOCK. > > > > All three patches are tested on a Raspberry Pi 5 running a 7.0.0-rc6 > > PREEMPT_RT kernel. On non-RT kernels there is zero behavioral change. > > > > Signed-off-by: Michael Byczkowski <[email protected]> > > Acked-by: Rodolfo Giometti <[email protected]> > > Tested-by: Michael Byczkowski <[email protected]> > > > > by (3): > > pps: pps-gpio: split IRQ handler into hardirq and threaded parts > > pps: convert pps_device lock to raw_spinlock for PREEMPT_RT > > pps: convert pps_kc_hardpps_lock to raw_spinlock for PREEMPT_RT > > > > drivers/pps/clients/pps-gpio.c | 37 +++++++++++++++++++++++----------- > > drivers/pps/kapi.c | 18 ++++++++++------- > > drivers/pps/kc.c | 22 ++++++++++---------- > > drivers/pps/pps.c | 16 +++++++-------- > > include/linux/pps_kernel.h | 2 +- > > 5 files changed, 56 insertions(+), 39 deletions(-) > > > > -- > > 2.47.3 > > Gentle ping on this series. v4 patches 1/3 and 3/3 carried Rodolfo's > Acked-by; v5 addressed the remaining feedback on 2/3. Happy to rework > anything or split the series if that helps it move forward. Unfortunately apple mail is corrupting your patches :/ Greg KH usually applies patches for drivers/pps/, but I didn't add him here yet because the patches don't apply. If you can point me at a git branch for v5, I'd be happy to re-send the patches myself with your authorship. This is all useful for me and I'd like to help :) If you do it yourself, just make sure to add Greg to the Cc: list. Cheers, Calvin > Adding linux-rt-users@ and Sebastian on Cc in case there's interest from the > PREEMPT_RT side.