OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>,
	Konstantin Khorenko <khorenko@virtuozzo.com>,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 1/4] sched: fix cfs_rq::nr_iowait leak on the remote wakeup path
Date: Wed, 14 Oct 2026 11:23:01 +0000	[thread overview]
Message-ID: <010701a13a26c466-26dd582a-55b3-4904-affb-bd8f36c79e56-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261014-ct-iowait-v1-1-9d65fe37cf89@virtuozzo.com>

> 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@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


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-10-14 11:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 11:16 [Devel] [PATCH hci-8.1 0/4] sched: restore Container iowait accounting Vasileios Almpanis
2026-10-14 11:16 ` [Devel] [PATCH hci-8.1 1/4] sched: fix cfs_rq::nr_iowait leak on the remote wakeup path Vasileios Almpanis
2026-10-14 11:23   ` no-reply [this message]
2026-10-14 11:16 ` [Devel] [PATCH hci-8.1 2/4] sched: keep cfs_rq::nr_iowait balanced for throttled and class changing tasks Vasileios Almpanis
2026-10-14 11:24   ` no-reply
2026-10-14 11:16 ` [Devel] [PATCH hci-8.1 3/4] sched: account sleep and block time of a task group entity Vasileios Almpanis
2026-10-14 11:28   ` no-reply
2026-10-14 11:36     ` Vasileios Almpanis
2026-10-14 11:16 ` [Devel] [PATCH hci-8.1 4/4] sched: switch a sleeping task group entity between idle and iowait Vasileios Almpanis
2026-10-14 11:27   ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a13a26c466-26dd582a-55b3-4904-affb-bd8f36c79e56-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=vasileios.almpanis@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox