Linux cgroups development
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Tao Cui <cuitao@kylinos.cn>
Cc: tj@kernel.org, josef@toxicpanda.com, axboe@kernel.dk,
	 cgroups@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] blk-throttle: schedule parent dispatch in tg_flush_bios()
Date: Wed, 20 May 2026 21:33:21 +0900	[thread overview]
Message-ID: <ag2owaQQoigp_fSV@shinmob> (raw)
In-Reply-To: <20260520062420.1762788-1-cuitao@kylinos.cn>

On May 20, 2026 / 14:24, Tao Cui wrote:
> tg_flush_bios() schedules pending_timer on the child tg's own
> service_queue, which causes throtl_pending_timer_fn() to dispatch from
> the child's pending_tree.  For leaf cgroups this tree is empty, so the
> timer fires and exits without dispatching the throttled bio.
> 
> The throttled bio sits in the parent's pending_tree with disptime set
> to jiffies (THROTL_TG_CANCELING zeroes all dispatch times), but the
> parent's timer is never explicitly rescheduled.  The bio only gets
> dispatched when the parent timer eventually fires at its previously
> scheduled expiry.
> 
> Fix by calling throtl_schedule_next_dispatch(sq->parent_sq, true)
> instead, matching what tg_set_limit() already does.  This forces the
> parent's dispatch cycle to run immediately and flush all canceling
> bios without waiting for a stale timer.
> 
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>

Hello Tao,

Trial runs of blktests CI for this patch caught the failure of test case
throtl/004 using scsi_debug device. I tried to recreate the failure manually.
I applied the patch on v7.1-rc4 kernel, and ran the test case and got the
result below. Is this failure expected?


# ./check throtl/004
throtl/004 (nullb) (delete disk while IO is throttled)       [passed]
    runtime  1.546s  ...  1.332s
throtl/004 (sdebug) (delete disk while IO is throttled)      [failed]
    runtime  2.654s  ...  2.435s
    --- tests/throtl/004.out    2026-03-20 14:25:50.478000000 +0900
    +++ /home/shin/Blktests/blktests/results/nodev_sdebug/throtl/004.out.bad    2026-05-20 21:26:14.470000000 +0900
    @@ -1,3 +1,2 @@
     Running throtl/004
    -Input/output error
     Test complete

  reply	other threads:[~2026-05-20 12:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  6:24 [PATCH] blk-throttle: schedule parent dispatch in tg_flush_bios() Tao Cui
2026-05-20 12:33 ` Shin'ichiro Kawasaki [this message]
2026-05-20 14:20   ` Tao Cui
2026-05-20 23:39     ` Shin'ichiro Kawasaki
2026-05-21  2:54       ` Tao Cui
2026-05-21  4:54         ` Shin'ichiro Kawasaki
2026-05-21  7:54           ` Tao Cui
2026-05-21  9:04           ` Tao Cui

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=ag2owaQQoigp_fSV@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=cuitao@kylinos.cn \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=tj@kernel.org \
    /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