Comment by aero-glide2

Comment by aero-glide2 10 months ago

8 replies

Interestingly, whenever I touch my touchpad, the worst case latency shoots up 20x, even with RT patch. What could be causing this? And this is always on core 5.

femto 10 months ago

Perhaps the code associated with the touchpad has a priority greater than that you used to run cyclictest (80?). Does it still happen if you boost the priority of cyclictest to the highest possible, using the option:

--priority=99

Apply priority 99 with care to your own code. A tight endless loop with priority 99 will override pretty well everything else, so about the only way to escape will be to turn your computer off. Been there, done that :-)

  • snvzz 10 months ago

    The most important is to set the policy, described in sched(7), rather than the priority.

    Notice that without setting the priority, default policy is other, which is the standard one most processes get unless they request else.

    By setting priority (while not specifying policy), the policy becomes fifo, the highest, which is meant to give the cpu immediately and not preempt until process releases it.

    This implicit change in policy is why you see such brutal effect from setting priority.

robocat 10 months ago

Perhaps an SMM ring -2 touchpad driver?

If you're developing anything on x86 that needs realtime - how do you disable SMM drivers causing unexpected latency?

  • jabl 10 months ago

    Buy HW that can be flashed with coreboot?

    And while it won't (completely) remove SMM, https://github.com/corna/me_cleaner might get rid of some stuff. I think that's more about getting rid of spyware and ring -1 security bugs than improving real-time behavior though.

angus-g 10 months ago

Maybe a PS/2 touchpad that is triggering (a bunch of) interrupts? Not sure how hardware interrupts work with RT!

  • jabl 10 months ago

    One of the features of PREEMPT_RT is that it converts interrupt handlers to running in their own threads (with some exceptions, I believe), instead of being tacked on top of whatever thread context was active at the time like with the softirq approach the "normal" kernel uses. This allows the scheduler to better decide what should run (e.g. your RT process rather than serving interrupts for downloading cat pictures).

monero-xmr 10 months ago

Touchpad support very poor in Linux. I use System76 and the touchpad is always a roll of the dice with every kernel upgrade, despite it being a "good" distro / vendor