2009-11-19 16:19:05 +00:00
|
|
|
.\" Copyright (c) 2009 Alexander Motin <mav@FreeBSD.org>
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\"
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" 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.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2015-06-19 21:26:06 +00:00
|
|
|
.Dd June 19, 2015
|
2009-11-19 16:19:05 +00:00
|
|
|
.Dt ADA 4
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm ada
|
|
|
|
.Nd ATA Direct Access device driver
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Cd device ada
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2009-11-24 13:44:53 +00:00
|
|
|
driver provides support for direct access devices, implementing the
|
2009-11-19 16:19:05 +00:00
|
|
|
.Tn ATA
|
|
|
|
command protocol, that are attached to the system through a host adapter
|
2009-11-24 13:44:53 +00:00
|
|
|
supported by the CAM subsystem.
|
2009-11-19 16:19:05 +00:00
|
|
|
.Pp
|
2009-11-24 13:44:53 +00:00
|
|
|
The host adapter must also be separately configured into the system before an
|
2009-11-19 16:19:05 +00:00
|
|
|
.Tn ATA
|
|
|
|
direct access device can be configured.
|
|
|
|
.Sh COMMAND QUEUING
|
2015-06-19 21:26:06 +00:00
|
|
|
Command queuing allows the device to process multiple transactions
|
2009-11-19 16:19:05 +00:00
|
|
|
concurrently, often re-ordering them to reduce the number and length of
|
|
|
|
seeks.
|
|
|
|
.Tn ATA
|
2015-06-19 21:26:06 +00:00
|
|
|
defines two types of queuing:
|
|
|
|
.Tn TCQ (Tagged Command Queuing, PATA legacy)
|
2009-11-19 16:19:05 +00:00
|
|
|
and
|
2015-06-19 21:26:06 +00:00
|
|
|
.Tn NCQ (Native Command Queuing, SATA) .
|
2009-11-19 16:19:05 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2009-11-24 13:44:53 +00:00
|
|
|
device driver takes full advantage of NCQ, when supported.
|
|
|
|
To ensure that transactions to distant parts of the media,
|
|
|
|
which may be deferred indefinitely by servicing requests closer to the current
|
2009-11-19 16:19:05 +00:00
|
|
|
head position, are completed in a timely fashion, an ordered
|
|
|
|
transaction is sent every 7 seconds during continuous device operation.
|
|
|
|
.Sh CACHE EFFECTS
|
|
|
|
Many direct access devices are equipped with read and/or write caches.
|
|
|
|
Parameters affecting the device's cache are reported in device IDENTIFY data
|
|
|
|
and can be examined and modified via the
|
|
|
|
.Xr camcontrol 8
|
|
|
|
utility.
|
|
|
|
.Pp
|
|
|
|
The read cache is used to store data from device-initiated read ahead
|
|
|
|
operations as well as frequently used data.
|
|
|
|
The read cache is transparent
|
|
|
|
to the user and can be enabled without any adverse effect.
|
|
|
|
Most devices
|
|
|
|
with a read cache come from the factory with it enabled.
|
|
|
|
.Pp
|
|
|
|
The write cache can greatly decrease the latency of write operations
|
|
|
|
and allows the device to reorganize writes to increase efficiency and
|
|
|
|
performance.
|
|
|
|
This performance gain comes at a price.
|
|
|
|
Should the device
|
|
|
|
lose power while its cache contains uncommitted write operations, these
|
|
|
|
writes will be lost.
|
|
|
|
The effect of a loss of write transactions on
|
|
|
|
a file system is non-deterministic and can cause corruption.
|
|
|
|
Most
|
2009-11-24 13:44:53 +00:00
|
|
|
devices age write transactions to limit the vulnerability to a few transactions
|
|
|
|
recently reported as complete, but it is nonetheless recommended that
|
2009-11-19 16:19:05 +00:00
|
|
|
systems with write cache enabled devices reside on an Uninterruptible
|
|
|
|
Power Supply (UPS).
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
device driver ensures that the cache and media are synchronized upon
|
|
|
|
final close of the device or an unexpected shutdown (panic) event.
|
|
|
|
This ensures that it is safe to disconnect power once the operating system
|
|
|
|
has reported that it has halted.
|
|
|
|
.Sh SYSCTL VARIABLES
|
|
|
|
The following variables are available as both
|
|
|
|
.Xr sysctl 8
|
|
|
|
variables and
|
|
|
|
.Xr loader 8
|
|
|
|
tunables:
|
|
|
|
.Bl -tag -width 12
|
2011-04-08 14:42:29 +00:00
|
|
|
.It Va kern.cam.ada.retry_count
|
2009-11-19 16:19:05 +00:00
|
|
|
.Pp
|
|
|
|
This variable determines how many times the
|
|
|
|
.Nm
|
|
|
|
driver will retry a READ or WRITE command.
|
|
|
|
This does not affect the number of retries used during probe time or for
|
|
|
|
the
|
|
|
|
.Nm
|
|
|
|
driver dump routine.
|
|
|
|
This value currently defaults to 4.
|
2011-04-08 14:42:29 +00:00
|
|
|
.It Va kern.cam.ada.default_timeout
|
2009-11-19 16:19:05 +00:00
|
|
|
.Pp
|
|
|
|
This variable determines how long the
|
|
|
|
.Nm
|
|
|
|
driver will wait before timing out an outstanding command.
|
|
|
|
The units for this value are seconds, and the default is currently 30
|
|
|
|
seconds.
|
2011-04-08 14:42:29 +00:00
|
|
|
.It Va kern.cam.ada.spindown_shutdown
|
2010-10-24 16:31:57 +00:00
|
|
|
.Pp
|
|
|
|
This variable determines whether to spin-down disks when shutting down.
|
2012-03-29 05:02:12 +00:00
|
|
|
Set to 1 to enable spin-down, 0 to disable.
|
2010-10-26 19:10:59 +00:00
|
|
|
The default is currently enabled.
|
2014-10-22 08:54:10 +00:00
|
|
|
.It Va kern.cam.sort_io_queue
|
|
|
|
.It Va kern.cam.ada. Ns Ar X Ns Va .sort_io_queue
|
|
|
|
.Pp
|
|
|
|
These variables determine whether request queue should be sorted trying
|
|
|
|
to optimize head seeks.
|
|
|
|
Set to 1 to enable sorting, 0 to disable, -1 to leave it as-is.
|
|
|
|
The default is sorting enabled for HDDs and disabled SSDs.
|
2014-09-21 10:05:27 +00:00
|
|
|
.It Va kern.cam.ada.read_ahead
|
|
|
|
.It Va kern.cam.ada. Ns Ar X Ns Va .read_ahead
|
2011-04-08 14:42:29 +00:00
|
|
|
.It Va kern.cam.ada.write_cache
|
|
|
|
.It Va kern.cam.ada. Ns Ar X Ns Va .write_cache
|
2011-04-07 08:17:53 +00:00
|
|
|
.Pp
|
2014-09-21 10:05:27 +00:00
|
|
|
These variables determine whether device read-ahead and write caches
|
|
|
|
should be enabled globally or per-device or disabled.
|
2011-04-07 08:32:53 +00:00
|
|
|
Set to 1 to enable write cache, 0 to disable, -1 to leave it as-is.
|
2014-12-29 13:50:59 +00:00
|
|
|
Values modified at runtime take effect only after device reset
|
2014-02-21 12:17:27 +00:00
|
|
|
.Pq using the reset subcommand of Xr camcontrol 8 .
|
|
|
|
Because of that, this setting should be changed in
|
|
|
|
.Pa /boot/loader.conf
|
|
|
|
instead of
|
|
|
|
.Pa /etc/sysctl.conf .
|
|
|
|
The global default is currently 1.
|
2011-04-08 14:42:29 +00:00
|
|
|
The per-device default is to leave it as-is (follow global setting).
|
2009-11-19 16:19:05 +00:00
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width ".Pa /dev/ada*" -compact
|
|
|
|
.It Pa /dev/ada*
|
|
|
|
ATA device nodes
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ahci 4 ,
|
2010-03-04 11:09:49 +00:00
|
|
|
.Xr cam 4 ,
|
2009-11-24 13:44:53 +00:00
|
|
|
.Xr da 4 ,
|
2015-04-24 09:52:41 +00:00
|
|
|
.Xr mvs 4 ,
|
2009-11-24 13:44:53 +00:00
|
|
|
.Xr siis 4
|
2009-11-19 16:19:05 +00:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver first appeared in
|
|
|
|
.Fx 8.0 .
|
|
|
|
.Sh AUTHORS
|
2014-06-26 21:46:14 +00:00
|
|
|
.An Alexander Motin Aq Mt mav@FreeBSD.org
|