Re: Massive "Found bio_cmd = 0x5" with options CAM_IOSCHED_DYNAMIC

From: Warner Losh <imp_at_bsdimp.com>
Date: Thu, 05 May 2022 02:37:41 UTC
On Wed, May 4, 2022 at 6:03 PM Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
wrote:

> Hi.
>
> After updating src main git: f44280bf5fbb to git: 1599fc904d35,
> with options CAM_IOSCHED_DYNAMIC on kernel config file,
> A plenty of "Found bio_cmd = 0x5" appear on console and dmesg.
>
> With quick look under src/sys/, bio_cmd = 0x5 means BIO_FLUSH,
> and the printf() only appears on src/sys/cam/cam_iosched.c line 1621.[1]
>
> Maybe it actually wouldn't be harmful (just annoying), but possibly
> any conditions blocking BIO_FLUSH to reach there would be lost.
> (The printf() itself was already there at git: f44280bf5fbb.)
>
> If it's actualy not at all harmful, and BIO_FLUSH case is coming
> through here is intentional change, is it really needed to be printed?
>

It's a useless printf. I've removed it and posted an analysis in the commit
message. Basically, read_bias == 0 will queue other operations to bio_queue
now, so the printf is a false positive to find transactions that shouldn't
be
on the queue.

If you set read_bias = 1, then the messages will go away until you can
recompile.

I also don't need to know the storage, since this is independent of the
periphs...

Warner


> There were 4 commits to cam_iosched.c within the span.
>
>   cc1572ddeb8cd82879ce0cca634bf6a8830c0f40    [2]
>     cam iosched: Remove write bias when read bias = 0
>   b65803ba5773d5fb37fa2403105db199569a5811    [3]
>     cam iosched: default to no read bias in dynamic ioscheduling
>   d592c0db8ba773c143eeea28610288f800fa651a    [4]
>     cam: add hw.cam.iosched.read_bias
>   1599fc904d35cfa8eecad92818d1f4b55de6818f    [5]
>     iosched: Move bio_next() inside of the CAM_IOSCHED_DYNAMIC ifdef
>
>
> [1] https://cgit.freebsd.org/src/tree/sys/cam/cam_iosched.c#n1621
>
> [2]
>
> https://cgit.freebsd.org/src/commit/?id=cc1572ddeb8cd82879ce0cca634bf6a8830c0f40
>
> [3]
>
> https://cgit.freebsd.org/src/commit/?id=b65803ba5773d5fb37fa2403105db199569a5811
>
> [4]
>
> https://cgit.freebsd.org/src/commit/?id=d592c0db8ba773c143eeea28610288f800fa651a
>
> [5]
>
> https://cgit.freebsd.org/src/commit/?id=1599fc904d35cfa8eecad92818d1f4b55de6818f
>
>
> Regards.
>
> --
> Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>
>