mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhan Xusheng <zhanxusheng1024@gmail.com>
To: Christian Loehle <christian.loehle@arm.com>
Cc: Zhan Xusheng <zhanxusheng@xiaomi.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Balbir Singh <bsingharora@gmail.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Josh Snyder <joshs@netflix.com>,
	Kayra Cizmeci <kayracizmeci@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: Account blkio delay independently of delayed dequeue
Date: Thu, 15 Oct 2026 10:59:11 +0800	[thread overview]
Message-ID: <20261015025912.1541134-1-zhanxusheng@xiaomi.com> (raw)
In-Reply-To: <4ce12bff-9532-4b27-98f2-a807bbccfaf7@arm.com>

On 10/14/26 17:12, Christian Loehle wrote:
> Start accounting in try_to_block_task(), when the current task commits
> to blocking, before delayed dequeue or proxy execution can retain it on
> the runqueue. End accounting when clearing is_blocked, including queued
> wakeups and the proxy execution paths that let the current task continue.

This is the right place, and it subsumes my patch. Please drop mine
rather than queue both.

try_to_block_task() has only one caller, __schedule(), which passes prev,
and prev is rq->curr there. So @p is current, the argument-less
delayacct_blkio_start() is correct once the call lives there, and the
signature change I proposed is unnecessary.

The two also conflict: my patch rewrites the sched.h line yours deletes,
so applying mine first makes your sched.h hunk fail, and the new call in
try_to_block_task() would not compile against the changed prototype.

Reviewed-by: Zhan Xusheng <zhanxusheng@xiaomi.com>

One question. rq->nr_iowait stays in __block_task(), so the two now
measure different intervals: blkio delay from the commit to block,
nr_iowait from the actual dequeue. A task woken while still delayed is
accounted a blkio delay but was never counted in nr_iowait, so
procs_blocked in /proc/stat and the iowait time derived from
nr_iowait_cpu() still lose that window. The counter stays balanced,
because such a wakeup returns through ttwu_runnable() and never reaches
the atomic_dec() in ttwu_do_activate(), so this is not a leak. Is leaving
nr_iowait behind deliberate, or a follow-up?

Thanks,
Zhan Xusheng

  parent reply	other threads:[~2026-10-15  2:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  8:17 [PATCH] delayacct: Account blkio start on the correct task Zhan Xusheng
2026-10-14 15:20 ` Christian Loehle
2026-10-14 16:12   ` [PATCH] sched: Account blkio delay independently of delayed dequeue Christian Loehle
2026-10-14 16:55     ` Kayra Cizmeci
2026-10-15  2:59     ` Zhan Xusheng [this message]
2026-10-15 10:40       ` Christian Loehle
2026-10-15 11:37         ` [PATCHv2] sched: Account I/O waits " Christian Loehle
2026-10-15 12:02           ` Zhan Xusheng
2026-10-15 12:16           ` Kayra Cizmeci
2026-11-06  9:50           ` [tip: sched/urgent] sched/core: " tip-bot2 for Christian Loehle

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=20261015025912.1541134-1-zhanxusheng@xiaomi.com \
    --to=zhanxusheng1024@gmail.com \
    --cc=bsingharora@gmail.com \
    --cc=christian.loehle@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joshs@netflix.com \
    --cc=juri.lelli@redhat.com \
    --cc=kayracizmeci@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=zhanxusheng@xiaomi.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

all inboxes | Powered by JetHome®