Page MenuHomeFreeBSD

cam iosched: Use the write queue for BIO_ZONE commands
ClosedPublic

Authored by fk_fabiankeil.de on Sep 13 2017, 7:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 1:43 PM
Unknown Object (File)
Fri, Nov 8, 4:49 AM
Unknown Object (File)
Mon, Nov 4, 7:55 PM
Unknown Object (File)
Oct 28 2024, 11:58 AM
Unknown Object (File)
Oct 8 2024, 2:14 AM
Unknown Object (File)
Sep 30 2024, 11:24 PM
Unknown Object (File)
Sep 26 2024, 6:08 AM
Unknown Object (File)
Sep 25 2024, 8:17 PM
Subscribers
None

Details

Summary

cam iosched: Use the write queue for BIO_ZONE commands

... so they can't get executed ahead of writes that were sent
after them.

As a side effect this prevents the kernel message:
kernel: Found bio_cmd = 0x9
which cam_iosched_next_bio() emits when finding commands
other than BIO_READ in the read queue.

PR: 221973
Obtained from: ElectroBSD

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

As mentioned in the PR I'm not completely sure about the patch but
believe that using the write queue for BIO_ZONE commands is less
likely to cause problems than putting them one the read queue.

As I currently don't use SMR drives the patch hasn't been properly tested.

It prevents the kernel message:
kernel: Found bio_cmd = 0x9
which cam_iosched_next_bio() emits when finding commands
other than BIO_READ in the read queue, though.

The fact that BIO_ZONE commands are sometimes sent to non-SMR
drives may indicate another problem but I haven't looked into this
yet.

This works. However, it points to a larger issue with the cam iosched. We're not careful about honoring BIO_ORDERED commands....

This revision is now accepted and ready to land.Sep 20 2017, 8:58 PM

On second thought, when I commit this, I'll change it to bp->bio_cmd != BIO_READ.

This revision was automatically updated to reflect the committed changes.
In D12353#257717, @imp wrote:

This works. However, it points to a larger issue with the cam iosched. We're not careful about honoring BIO_ORDERED commands....

I'm aware of this, mainly because you mentioned it in the commit message of r298002.

At the moment I'm only using cam iosched with ZFS and my impression is
that the ordering issue is sufficiently "masked" by ZFS's copy-on-write behaviour.

I suspect that other file systems are more likely to be negatively affected
by it than ZFS. I haven't looked into this, though, as I don't want to use
other file systems with cam iosched anyway.

In D12353#257717, @imp wrote:

This works. However, it points to a larger issue with the cam iosched. We're not careful about honoring BIO_ORDERED commands....

I'm aware of this, mainly because you mentioned it in the commit message of r298002.

At the moment I'm only using cam iosched with ZFS and my impression is
that the ordering issue is sufficiently "masked" by ZFS's copy-on-write behaviour.

I suspect that other file systems are more likely to be negatively affected
by it than ZFS. I haven't looked into this, though, as I don't want to use
other file systems with cam iosched anyway.

ZFS doesn't use BIO_ORDERED writes. g_io_flush() is the only thing it does that's ordered.

UFS also has some BIO_ORDERED I/O.