Bug 221973

Summary: cam iosched: BIO_ZONE commands probably shouldn't use the read queue
Product: Base System Reporter: Fabian Keil <fk>
Component: kernAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Some People CC: emaste, imp
Priority: --- Keywords: patch
Version: CURRENTFlags: fk: mfc-stable11?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
cam iosched: Use the write queue for BIO_ZONE commands none

Description Fabian Keil 2017-09-01 10:09:30 UTC
Created attachment 185970 [details]
cam iosched: Use the write queue for BIO_ZONE commands

The attached patch lets iosched put BIO_ZONE commands on the write queue
so they can't get executed ahead of writes that were sent after them.

I'm not completely sure but believe that this 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.

Obtained from: ElectroBSD
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-09-20 21:13:37 UTC
A commit references this bug:

Author: imp
Date: Wed Sep 20 21:13:21 UTC 2017
New revision: 323828
URL: https://svnweb.freebsd.org/changeset/base/323828

Log:
  cam iosched: Use the write queue for BIO_ZONE commands

  Use the write queue for BIO_ZONE commands so they can't get executed
  ahead of writes that were sent after them. More generally, since they
  introduce strong ordering into the list, they need to go to the write
  queue (which is the only queue that BIO_ORDERED is honored for at the
  moment). In fact, fix mismatch between queueing and dequeueing code by
  changing this to queue all non-reads (and non-trims) to the write
  queue.

  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
  Submitted by: Fabian Keil
  Differential Revision: https://reviews.freebsd.org/D12353

Changes:
  head/sys/cam/cam_iosched.c
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-12-04 14:12:57 UTC
MFC plans?
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2020-07-11 03:15:36 UTC
^Triage: Assign to committer resolving

With bugmeister hat, I think any possible MFCs from 3 years ago are OBE.