[PATCH]export device_busy for sdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi James,

Attached please find patch for export device_busy for sdev.

The reason I do this is:

Sometime we see doing IO on several devices, on device may starve
others, eg:

I run fio on top the 4 disks exported by scst using srp:
(SRP default can_queue/cmd_per_lun is 62)
/dev/sdb: (g=0): rw=randread, bs=4K-16K/4K-16K/4K-16K, ioenine=libaio,
iodepth=64
/dev/sdc: (g=0): rw=randread, bs=4K-16K/4K-16K/4K-16K, ioengine=libaio,
iodepth=64
/dev/sdd: (g=0): rw=randread, bs=4K-16K/4K-16K/4K-16K, ioengine=libaio,
iodepth=64
>  sdb: ios=16393/0, merge=2770/0, ticks=863050/0, in_queue=870110, util=99.43%
>   sdc: ios=5896/0, merge=0/0, ticks=997110/0, in_queue=1006470, util=99.52%
>   sdd: ios=15976/0, merge=0/0, ticks=978850/0, in_queue=984960, util=99.38%

A monitor to read device_busy every seconds show:
> Sleeping for 1 seconds...
> Getting device busy data for sdb  0    (tstamp=20130912172053)...
> Getting device busy data for sdc  62    (tstamp=20130912172053)...
> Getting device busy data for sde  0    (tstamp=20130912172053)...
> 
> Sleeping for 1 seconds...
> Getting device busy data for sdb  0    (tstamp=20130912172054)...
> Getting device busy data for sdc  62    (tstamp=20130912172054)...
> Getting device busy data for sde  0    (tstamp=20130912172054)...
> 
> Sleeping for 1 seconds...
> Getting device busy data for sdb  0    (tstamp=20130912172055)...
> Getting device busy data for sdc  62    (tstamp=20130912172055)...
> Getting device busy data for sde  0    (tstamp=20130912172055)...

Which give admin more hint about the situation.

Best regards,
Jack
>From cbca8a40fe3837789129e210365488d329d8a440 Mon Sep 17 00:00:00 2001
From: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxxx>
Date: Thu, 12 Sep 2013 16:57:16 +0200
Subject: [PATCH] export device_busy for sdev

If you mutiple devices connect to a host, we might be interested in
have an intensive I/O workload on one disk, and notice starvation on others.
This give the user more hint about current infight io for scsi device.

Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxxx>
---
 drivers/scsi/scsi_sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 40c6394..a734710 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -529,6 +529,7 @@ static int scsi_sdev_check_buf_bit(const char *buf)
  */
 sdev_rd_attr (device_blocked, "%d\n");
 sdev_rd_attr (queue_depth, "%d\n");
+sdev_rd_attr (device_busy, "%d\n");
 sdev_rd_attr (type, "%d\n");
 sdev_rd_attr (scsi_level, "%d\n");
 sdev_rd_attr (vendor, "%.8s\n");
@@ -750,6 +751,7 @@ static struct attribute *scsi_sdev_attrs[] = {
 	&dev_attr_device_blocked.attr,
 	&dev_attr_type.attr,
 	&dev_attr_scsi_level.attr,
+	&dev_attr_device_busy.attr,
 	&dev_attr_vendor.attr,
 	&dev_attr_model.attr,
 	&dev_attr_rev.attr,
-- 
1.8.4


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux