Re: [PATCH blktests v4 0/3] bcache: add initial test cases

Stephen Zhang <[email protected]> Wed, 4 Mar 2026 14:41:11 +0800
Newsgroups org.kernel.vger.linux-bcache,org.kernel.vger.linux-block
Message-ID <CANubcdU92Uv7wNdZH357LLTnfwPouekXNTPSjHnzYzK99-eZ9w@mail.gmail.com>
Daniel Wagner <[email protected]> 于2026年3月3日周二 16:04写道:
>
> Hi Shinichiro,
>
> On Tue, Mar 03, 2026 at 12:57:18AM +0000, Shinichiro Kawasaki wrote:
> > On Mar 02, 2026 / 14:54, Daniel Wagner wrote:
> > > On Thu, Feb 12, 2026 at 04:23:30PM +0100, Daniel Wagner wrote:
> > > > I've updated the v3 version with the feedback from Shinichiro for v2.
> > > > Shinichiro, please note I did rewrite some of the logic in v3, thus some of your
> > > > comments didn't apply. But hopefully I don't made a big mess :)
> > >
> > > ping
> >
> > Daniel, I wonder if my replies [1][2] reached your mail box.
>
> Sorry, no, they didn't. Yet another hickup with our mail server...
>
> > [1] https://lore.kernel.org/linux-block/aZQZkjEUw9VnVauX@shinmob/
> > [2] https://lore.kernel.org/linux-block/aZQcH-d-ZcgtMoJb@shinmob/
>
> I'll work on this then.
>
> > Today, I tried this patch series again on v7.0-rc2 kernel with the
> > TEST_CASE_DEV_ARRAY below:
> >
> >   TEST_CASE_DEV_ARRAY[bcache/*]="/dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme4n1"
> >
> > And found that new files named "nvme?n1" are created in the current directory.
> > Do you see the files created in your environment?
>
> Will check.
>
> > Also I saw the failure with the message "ERROR: Accounting leak detected!" as I
> > noted in [2].
>
> I am not really sure if this test case should go in the current form.
> I've just used Stephen's test case as input for figuring out what kind
> of API is useful. I also see the leak error with v7.0-rc1 which has
> 3ef825dfd4e4 ("bcache: use bio cloning for detached device requests").
> I might have done something wrong here.
>

Hi,
I noticed an issue with the test. The 100% utilization shown by iostat
during active I/O is NORMAL! The test is flawed - it's checking
utilization while fio is still running.
The test does:
1. Start fio in background with --runtime=30
2. Sleep only 5 seconds
3. Check iostat immediately (while fio is still active!)
A real leak would show persistent utilization AFTER all I/O completes.
During active I/O, 100% utilization is expected behavior.
To properly detect a leak, the test should:
1. Wait for fio to complete (wait $fio_pid)
2. Wait a few seconds for I/O to drain
3. Then check iostat
If utilization is still > 0% after I/O completes, then there's a real
accounting leak.

Thanks,
Shida


> BTW, iostat could be replaced by reading directly from sysfs,
> e.g. /sys/block/nvme0n1/stat
>
> Thanks,
> Daniel