linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv7 0/4] New EH command timeout handler
@ 2013-10-30  8:37 Hannes Reinecke
  2013-10-30  8:37 ` [PATCH 1/4] scsi: Fix erratic device offline during EH Hannes Reinecke
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Hannes Reinecke @ 2013-10-30  8:37 UTC (permalink / raw)
  To: James Bottomley
  Cc: Christoph Hellwig, linux-scsi, Ren Mingxin, Joern Engel,
	James Smart, Hannes Reinecke

Hi all,

this patchset implements a new SCSI EH command timeout handler
which will be sending command aborts inline without actually
engaging SCSI EH.
SCSI EH will only be invoked if command abort fails.

In addition the commands will be returned directly
if the command abort succeeded, cutting down recovery
times dramatically.

With the original SCSI EH I got:
# time dd if=/dev/zero of=/dev/dm-2 bs=4k count=4k oflag=direct
4096+0 records in
4096+0 records out
16777216 bytes (17 MB) copied, 142.652 s, 118 kB/s

real	2m22.657s
user	0m0.013s
sys	0m0.145s

With this patchset I got:
# time dd if=/dev/zero of=/dev/dm-2 bs=4k count=4k oflag=direct
4096+0 records in
4096+0 records out
16777216 bytes (17 MB) copied, 52.1579 s, 322 kB/s

real	0m52.163s
user	0m0.012s
sys	0m0.145s

Test was to disable RSCN on the target port, disable the
target port, and then start the 'dd' command as indicated.

Changes to the original version:
- Use a private list in scsi_eh_abort_handler to avoid
  list starvation (pointed out by Joern Engel)
- Terminate command aborts when the first abort fails
- Do not attempt command aborts if the host is already in recovery
  or if the device is removed.
- Flush abort workqueue if the device is removed.

Changes to v2:
- Removed eh_entry initialisation
- Convert to per-command workqueue

Changes to v3:
- Use delayed_work
- Enable new eh timeout handler for virtio, SAS, and FC
- Modify logging messages to include scmd pointer

Changes to v4:
- Remove stubs when enabling new eh timeout handler
  for other drivers

Changes to v5:
- Enable new eh timeout handler per default
- Update documentation

Changes to v6:
- Include changes from James Bottomley for erratic device
  offline patch
- Rearrange patches
- Update SCSI midlayer documentation

Hannes Reinecke (3):
  blk-timeout: add BLK_EH_SCHEDULED return code
  scsi: improved eh timeout handler
  scsi: Update documentation

James Bottomley (1):
  scsi: Fix erratic device offline during EH

 Documentation/scsi/scsi_eh.txt          |  69 +++++++------
 Documentation/scsi/scsi_mid_low_api.txt |   9 +-
 drivers/scsi/scsi.c                     |   9 +-
 drivers/scsi/scsi_error.c               | 176 ++++++++++++++++++++++++++++----
 drivers/scsi/scsi_priv.h                |   2 +
 drivers/scsi/sd.c                       |  26 +++--
 include/linux/blkdev.h                  |   1 +
 include/scsi/scsi_cmnd.h                |   2 +
 include/scsi/scsi_driver.h              |   2 +-
 include/scsi/scsi_host.h                |   5 +
 10 files changed, 228 insertions(+), 73 deletions(-)

-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH 0/4] New SCSI command timeout handler
@ 2013-06-06  9:43 Hannes Reinecke
  2013-06-06  9:43 ` [PATCH 3/4] scsi: improved eh " Hannes Reinecke
  0 siblings, 1 reply; 16+ messages in thread
From: Hannes Reinecke @ 2013-06-06  9:43 UTC (permalink / raw)
  To: James Bottomley
  Cc: linux-scsi, Joern Engel, Ewan Milne, James Smart, Ren Mingxin,
	Roland Dreier, Bryn Reeves, Christoph Hellwig, Hannes Reinecke

Hi all,

this is the first step towards a new non-blocking
error handler. This patch implements a new command
timeout handler which will be sending command aborts
inline without engaging SCSI EH.

In addition the commands will be returned directly
if the command abort succeeded, cutting down recovery
times dramatically.

With the original scsi error recovery I got:
# time dd if=/dev/zero of=/mnt/test.blk bs=512 count=2048 oflag=sync
2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB) copied, 3.72732 s, 281 kB/s

real	2m14.475s
user	0m0.000s
sys	0m0.104s

with this patchset I got:
# time dd if=/dev/zero of=/mnt/test.blk bs=512 count=2048 oflag=sync
2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB) copied, 31.5151 s, 33.3 kB/s

real	0m31.519s
user	0m0.000s
sys	0m0.088s

Test was to disable RSCN on the target port, disable the
target port, and then start the 'dd' command as indicated.

As a proof-of-concept I've also enabled the new timeout
handler for virtio, so that things can be tested out
more easily.

Comments etc are welcome.

Hannes Reinecke (4):
  scsi: move initialization of scmd->eh_entry
  blk-timeout: add BLK_EH_SCHEDULED return code
  scsi: improved eh timeout handler
  virtio_scsi: use improved eh timeout handler

 drivers/scsi/scsi_error.c        | 82 ++++++++++++++++++++++++++++++++++++++++
 drivers/scsi/scsi_lib.c          |  4 +-
 drivers/scsi/scsi_scan.c         |  3 ++
 drivers/scsi/scsi_transport_fc.c |  3 +-
 drivers/scsi/virtio_scsi.c       |  8 ++++
 include/linux/blkdev.h           |  1 +
 include/scsi/scsi_cmnd.h         |  1 +
 include/scsi/scsi_device.h       |  2 +
 8 files changed, 101 insertions(+), 3 deletions(-)

-- 
1.7.12.4


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-10-30 17:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-30  8:37 [PATCHv7 0/4] New EH command timeout handler Hannes Reinecke
2013-10-30  8:37 ` [PATCH 1/4] scsi: Fix erratic device offline during EH Hannes Reinecke
2013-10-30  8:37 ` [PATCH 2/4] blk-timeout: add BLK_EH_SCHEDULED return code Hannes Reinecke
2013-10-30  8:43   ` Christoph Hellwig
2013-10-30 19:15     ` Hannes Reinecke
2013-10-30  8:37 ` [PATCH 3/4] scsi: improved eh timeout handler Hannes Reinecke
2013-10-30  8:37 ` [PATCH 4/4] scsi: Update documentation Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2013-06-06  9:43 [PATCH 0/4] New SCSI command timeout handler Hannes Reinecke
2013-06-06  9:43 ` [PATCH 3/4] scsi: improved eh " Hannes Reinecke
2013-06-06 16:23   ` Jörn Engel
2013-06-06 20:39     ` Hannes Reinecke
2013-06-06 20:28       ` Jörn Engel
2013-06-07  6:25         ` Ren Mingxin
2013-06-07  6:42           ` Hannes Reinecke
2013-06-07 16:21   ` Jörn Engel
2013-06-10  0:12   ` Baruch Even
2013-06-10  5:48     ` Hannes Reinecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).