megaraid: Add support for change_queue_depth
Quoted 6 lines · ---- "Ju
Hi,
Quoted 2 lines · brking
Adds support for
change_queue_depthso that device queue depth can be changed at runtime through sysfs.Can you share any reason to have queue depth chanaged at runtime? It is set with
MBOX_MAX_SCSI_CMDSat driver attach.
For my own purposes, I've been wanting to try different max queue depths to see how it affects my overall performance when memory is fragmented after the system has been up for a while, so rebooting to try a different queue depth doesn't help me much.
Brian
Quoted 61 lines
Thank you,
Seokmann
Quoted 56 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, July 05, 2006 6:00 PM
To: Kolli, Neela
Cc: Ju, Seokmann; [email protected]; [email protected]
Subject: [patch 1/1] megaraid: Add support forchange_queue_depthAdds support for
change_queue_depthso that device queue depth can be changed at runtime through sysfs.Signed-off-by <[email protected]>---
diff -puN
drivers/scsi/megaraid/megaraid_mbox.c~megaraid_change_queue_depthdrivers/scsi/megaraid/megaraid_mbox.c
---
linux-2.6/drivers/scsi/megaraid/megaraid_mbox.c~megaraid_change_queue_depth2006-07-05 14:00:04.000000000 -0500
+++linux-2.6-brking/drivers/scsi/megaraid/megaraid_mbox.c2006-07-05 16:53:36.000000000 -0500(quoted diff) +15
-0@@ -330,6 +330,21 @@ static struct device_attribute *megaraid NULL, }; +/** + * megaraid_change_queue_depth - Change the device's queue depth + * @sdev: scsi device struct + * @qdepth: depth to set + * + * Return value: + * actual depth set + **/ +static int megaraid_change_queue_depth(struct scsi_device *sdev, int qdepth) +{ + if (qdepth > MBOX_MAX_SCSI_CMDS) + qdepth = MBOX_MAX_SCSI_CMDS; + scsi_adjust_queue_depth(sdev, 0, qdepth); + return sdev->queue_depth; +} /** Scsi host template for megaraid unified driver
(quoted diff) +1
-0@@ -343,6 +358,7 @@ static struct scsi_host_template megarai .eh_device_reset_handler = megaraid_reset_handler, .eh_bus_reset_handler = megaraid_reset_handler, .eh_host_reset_handler = megaraid_reset_handler, + .change_queue_depth = megaraid_change_queue_depth, .use_clustering = ENABLE_CLUSTERING, .sdev_attrs = megaraid_sdev_attrs, .shost_attrs = megaraid_shost_attrs,_