HomeFreeBSD

cam: Optimize write protection MODE SENSE in da(4).

Description

cam: Optimize write protection MODE SENSE in da(4).

Before this change on every open da(4) driver read all mode pages to
use only one bit. It was done so to not depend on the list of pages
supported by the disk. But I've found that at least for SATL of LSI/
Broadcom HBAs with WD HDDs Power Condition mode page reading may take
significant amount of time, much more than any other mode page, that
visibly increased disk retaste time by GEOM.

Address that by using data returned by the first MODE SENSE request
to limit the following ones to only one (the first for now) mode page.

With the change simultaneous retaste of 39 SATA disks takes about 2.5s
instead of more than 4s before, and I no longer see "dareprobe" status
on GEOM event thread.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

(cherry picked from commit a9a2cdaf3c193ee1b597d0eef51544636421d973)

Details

Provenance
mavAuthored on Jan 14 2022, 10:48 PM
Parents
rG7b540b831d07: cam: Fix type of elm_idx in struct enc_element.
Branches
Unknown
Tags
Unknown