On Mon, Nov 02, 2026 at 05:09:42PM -0500, Michael S. Tsirkin wrote:
> Could you pls respond to Sashiko's review?

On review, Sashiko's points don't seem to hold:

1. throttle_cfs_rq_work() runs from task_work_run(), which calls
   cond_resched() after each work item:

        do {
                next = work->next;
                work->func(work);
                work = next;
                cond_resched();
        } while (work);

   throttle_cfs_rq_work() has already called resched_curr(), so with
   preempt=none/voluntary the worker is switched out at that
   cond_resched(). With preempt=full/lazy it is switched out earlier,
   at the rq unlock. Either way this happens inside
   resume_user_mode_work(), before vtsk->fn(), with no locks held.
   Traced on 6.18 with preempt=none: each throttle switch-out was in
   __cond_resched() called from task_work_run().

2. Depends on fn() running while throttled, which per 1 doesn't
   happen.

3. Re-armed throttle work is queued at pick time and run by
   task_work_run() before it returns. Anything armed later is handled
   at the next loop top, which is normal deferred throttling.

Will raise a v2 now with Shakeel's previous points.

Kind Regards
Aamir

Reply via email to