Linux block layer
 help / color / mirror / Atom feed
From: Tao Cui <cui.tao@linux.dev>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: cui.tao@linux.dev, linux-block@vger.kernel.org, hch@lst.de,
	yukuai@kernel.org, Tao Cui <cuitao@kylinos.cn>
Subject: Re: [PATCH blktests] tests/throtl: add a new test 009
Date: Thu, 20 Aug 2026 16:43:02 +0800	[thread overview]
Message-ID: <8cd35439-66b6-4bc2-94bf-dd2dde47aad7@linux.dev> (raw)
In-Reply-To: <aoRRlY5AeMaRBXMh@shinhome>


Hi Shin'ichiro,

在 2026/8/18 20:42, Shin'ichiro Kawasaki 写道:
> On Aug 13, 2026 / 22:40, Tao Cui wrote:
>> From: Tao Cui <cuitao@kylinos.cn>
>>
>> Test the boundary condition of removing a cgroup while it still has IO
>> queued in the blk-throttle queue.  The queued bios must be flushed through
>> without any blk-cgroup or blk-throttle warning.
>>
>> The dmesg check matches any blk-cgroup / blk-throttle warning rather than a
>> single call site, so it is not tied to one symbol.
> 
> Tao, thanks for the patch. Does this test case have corresponding kernel side
> fix? I'm guessing that your recent kernel patch is the fix. If so, I suggest
> to mention the kernel commit in here and the test case header comment below.
> 


Thanks for the review.

No.  Christoph asked me to add the reproducer to blktests in that RFC
thread [1], that's how this patch came about.

The WARN it catches came from yukuai's "store blkcg in bio" RFC v1, which
is not merged: bio_pinned_blkg() re-looked up a blkg that blkg_destroy()
had already removed from the radix tree, while a queued throttled bio
still pinned it.  RFC v2 fixed it with blkg_lookup_any(), and mainline
passes this test too, since the blkg stays findable until queued bios
drain.

>>
>> Signed-off-by: Tao Cui <cuitao@kylinos.cn>
>> ---
>> See also the related blkcg "store blkcg in bio" RFC:
>> https://lore.kernel.org/r/20260804065313.2092022-1-yukuai@kernel.org
>>
>>  tests/throtl/009     | 67 ++++++++++++++++++++++++++++++++++++++++++++
>>  tests/throtl/009.out |  2 ++
>>  2 files changed, 69 insertions(+)
>>  create mode 100755 tests/throtl/009
>>  create mode 100644 tests/throtl/009.out
>>
>> diff --git a/tests/throtl/009 b/tests/throtl/009
>> new file mode 100755
>> index 0000000..1f4ed67
>> --- /dev/null
>> +++ b/tests/throtl/009
>> @@ -0,0 +1,67 @@
>> +#!/bin/bash
>> +# SPDX-License-Identifier: GPL-3.0+
>> +# Copyright (C) 2026 Tao Cui <cuitao@kylinos.cn>
>> +#
>> +# Regression test for removing a cgroup while IO is still queued in the
>> +# blk-throttle queue.  The queued bios must be flushed without any
>> +# blk-cgroup or blk-throttle warning, and without leaking the blkg
>> +# reference they pin.
>> +
>> +. tests/throtl/rc
>> +
>> +THROTL_BLKDEV_TYPES="nullb"
> 
> Is there any reason to run this test case only for nullb? If not, I suggest to
> remove the line above to run it for both nullb and scsi_debug.

> Is there any reason to run this test case only for nullb?

The test just exercises the blk-throttle/blk-cgroup path on cgroup
removal and doesn't depend on the device type, nullb is simply the most
convenient.  Dropping THROTL_BLKDEV_TYPES is fine with me if you want
scsi_debug covered too.

[1] https://lore.kernel.org/r/20260804065313.2092022-1-yukuai@kernel.org

Thanks,
Tao



  reply	other threads:[~2026-08-20  8:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 14:40 [PATCH blktests] tests/throtl: add a new test 009 Tao Cui
2026-08-18 12:42 ` Shin'ichiro Kawasaki
2026-08-20  8:43   ` Tao Cui [this message]
2026-08-20 10:32     ` Shin'ichiro Kawasaki

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=8cd35439-66b6-4bc2-94bf-dd2dde47aad7@linux.dev \
    --to=cui.tao@linux.dev \
    --cc=cuitao@kylinos.cn \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=yukuai@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