Re: [RFC PATCH v2 0/7] Defer throttle when task exits to user

K Prateek Nayak
2025-04-22T02:54:55Z

Hello Aaron,

On 4/22/2025 7:40 AM, Aaron Lu wrote:
>> anon_pipe_write()
>> __wake_up_common()
>> ep_poll_callback() {
>> read_lock_irq(&ep->lock) /* Read lock acquired here */
> I was confused by this function's name. I had thought irq is off but
> then realized under PREEMPT_RT, read_lock_irq() doesn't disable irq...

Yup! Most of the interrupt handlers are run by the IRQ threads on
PREEMPT_RT and the ones that do run in the interrupt context have all
been adapted to use non-blocking locks whose *_irq variants disables
interrupts on PREEMPT_RT too.

>
>> __wake_up_common()
>> ep_autoremove_wake_function()
>> try_to_wake_up() /* Wakes up "epoll-stall" */
>> preempt_schedule()
>> ...
>>
>> # "epoll-stall-writer" has run out of bandwidth, needs replenish to run
> Luckily in this "only throttle when ret2user" model, epoll-stall-writer
> does not need replenish to run again(and then unblock the others).

I can confirm that throttle deferral solves this issue. I have run Jan's
reproducer for a long time without seeing any hangs on your series. I
hope Florian can confirm the same.

--
Thanks and Regards,
Prateek