diff options
author | smh <smh@FreeBSD.org> | 2013-03-29 22:58:15 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2013-03-29 22:58:15 +0000 |
commit | fc36a232b91d6ddc6b7d1429049d052764181391 (patch) | |
tree | bb7d2f8108f86f3417b00d4bf9c025cf6f66ae71 /sys/cam/cam.c | |
parent | 35fe5219abd995454f3d1279b840072f555159c3 (diff) | |
download | FreeBSD-src-fc36a232b91d6ddc6b7d1429049d052764181391.zip FreeBSD-src-fc36a232b91d6ddc6b7d1429049d052764181391.tar.gz |
Adds the ability to enable / disable sorting of BIO requests queued within
CAM. This can significantly improve performance particularly for SSDs
which don't suffer from seek latencies.
The sysctl / tunable kern.cam.sort_io_queues provides the systems default
setting where:-
0 = queued BIOs are NOT sorted
1 = queued BIOs are sorted (default)
Each device gets its own sysctl kern.cam.<type>.<id>.sort_io_queue
Valid values are:-
-1 = use system default (default)
0 = queued BIOs are NOT sorted
1 = queued BIOs are sorted
Note: Additional patch will look to add automatic use of none sorted queues
for none rotating media e.g. SSD's
Reviewed by: scottl
Approved by: pjd (mentor)
MFC after: 2 weeks
Diffstat (limited to 'sys/cam/cam.c')
-rw-r--r-- | sys/cam/cam.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/cam/cam.c b/sys/cam/cam.c index 4445d03..f608d6f 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -110,6 +110,15 @@ const int num_cam_status_entries = #ifdef _KERNEL SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem"); + +#ifndef CAM_DEFAULT_SORT_IO_QUEUES +#define CAM_DEFAULT_SORT_IO_QUEUES 1 +#endif + +int cam_sort_io_queues = CAM_DEFAULT_SORT_IO_QUEUES; +TUNABLE_INT("kern.cam.sort_io_queues", &cam_sort_io_queues); +SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN, + &cam_sort_io_queues, 0, "Sort IO queues to try and optimise disk access patterns"); #endif void |