cam: Reduce overly long timeout values for initial device probing

Currently, we have very long timeouts for the initial probing
commands. However, these are not appropriate for modern (post 2010) SCSI
disks. Sandards since SPC3 state that these commands should not wait for
media access. Since we retry them several times during the initial bus
scan, these delays can delay the boot by minutes (5 minutes per errant
disk in our expereince). These delays don't help and only hurt, so
reduce the TESTUNITREADY, INQUIRY and MODESENSE commands (during the
initial probe). Provide sysctl/tuneables to change the time for these
and also the REPORTLUNS commands for people that might need to adjust
them for devices that violate this belief but none-the-less work with
longer timeouts.
	kern.cam.tur_timeout		(default was 60s, now 1s)
	kern.cam.inquiry_timeout	(default was 60s, now 1s)
	kern.cam.reportluns_timeout	(default is 60s)
	kern.cam.modesense_timeout	(default was 60s, now 1s)
This can be partially merged: the sysctls can, but the new defaults likely
shouldn't.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D52427
This commit is contained in:
Warner Losh
2025-12-11 12:05:32 -07:00
parent b9915c27a7
commit 8ac7a3801c
3 changed files with 66 additions and 7 deletions
+33 -1
View File
@@ -22,7 +22,7 @@
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.Dd December 11, 2023
.Dd December 11, 2025
.Dt CAM 4
.Os
.Sh NAME
@@ -69,6 +69,38 @@ appropriate drivers.
The
.Xr pass 4
driver, if it is configured in the kernel, will attach to all devices.
.Sh SYSCTL VARIABLES
The following variables are available as both
.Xr sysctl 8
variables and
.Xr loader 8
tunables:
.Bl -tag -width 12
.It Va kern.cam.cam_srch_hi
Search above LUN 7 for SCSI3 and greater devices.
.It Va kern.cam.tur_timeout
Timeout, in ms, for the initial TESTUNITREADY command we send to the devices
during their initial probing.
Defaults to 1s.
.Fx 15
and earlier set this to 60s.
.It Va kern.cam.inquiry_timeout
Timeout, in ms, for the initial INQUIRY command we send to the devices
during their initial probing.
Defaults to 1s.
.Fx 15
and earlier set this to 60s.
.It Va kern.cam.reportluns_timeout
Timeout, in ms, for the initial REPORTLUNS command we send to the devices
during their initial probing.
Defaults to 50s.
.It Va kern.cam.modesense_timeout
Timeout, in ms, for the initial MODESENSE command we send to the devices
during their initial probing.
Defaults to 1s.
.Fx 15
and earlier set this to 60s.
.El
.Sh KERNEL CONFIGURATION
There are a number of generic kernel configuration options for the
.Nm