Skip to contentSkip to conversation

export device_busy for sdev

PATCH New Jack Wang 1 participant 1 message Sep 12, 2013 SCSI

lore
Share & tools
lore

Jack Wang

author
#0 lore raw

PATCH 1/1 export device_busy for sdev

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

Quoted 3 lines

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:

Quoted 6 lines

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...

Quoted 8 lines
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

Quoted 1 line

From cbca8a40fe3837789129e210365488d329d8a440 Mon Sep 17 00:00:00 2001

From: Jack Wang <[email protected]>
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.

---
 drivers/scsi/scsi_sysfs.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/scsi_sysfs.c +2 -0
index 40c6394..a734710 100644
@@ -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,
Signature · 1 line
1.8.4