[Devel] [PATCH hci-8.1 1/4] sched: fix cfs_rq::nr_iowait leak on the remote wakeup path
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Oct 14 14:23:01 MSK 2026
> try_to_wake_up() decrements cfs_rq::nr_iowait only after the
> p->on_cpu check. If the task's CPU is still in schedule(), the wakeup
> is queued with ttwu_queue_wakelist() and try_to_wake_up() returns
> early, so the counter is never decremented. It keeps growing and shows
> up as a bogus procs_blocked in the CT's /proc/stat:
>
> # grep procs_blocked /proc/stat
> procs_blocked 70
>
> With NO_TTWU_QUEUE the leak goes away.
>
> Fix it by doing the decrement where rq::nr_iowait is handled: in
> try_to_wake_up() before set_task_cpu() for migrating wakeups, and in
> ttwu_do_activate() for all others, which also covers the wakelist.
> This way non migrating wakeups don't take the rq lock for it anymore.
>
> A task on the wakelist is TASK_WAKING but still counted, so add
> task_in_nr_iowait() and use it in sched_move_task() instead of
> skipping every TASK_WAKING task.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-147823
> Fixes: 415fe063c53e ("sched: Account cfs_rq::nr_iowait")
> Signed-off-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261014-ct-iowait-v1-0-9d65fe37cf89@virtuozzo.com?part=1
More information about the Devel
mailing list