Skip to contentSkip to conversation

scsi_execute_async() should add to the tail of the queue

PATCH In review Dan Aloni 2 participants 3 messages Dec 19, 2006 – Dec 21, 2006 SCSI

lore
Share & tools
lore

Dan Aloni

author
#0 lore raw

PATCH 1/1 scsi_execute_async() should add to the tail of the queue

Hello,

scsi_execute_async() has replaced scsi_do_req() a few versions ago, but it also incurred a change of behavior. I noticed that over-queuing a SCSI device using that function causes I/Os to be starved from low-level queuing for no justified reason.

I think it makes much more sense to perserve the original behaviour of scsi_do_req() and add the request to the tail of the queue.

drivers/scsi/scsi_lib.c +1 -1
diff -p -urN a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
@@ -421,7 +421,7 @@ int scsi_execute_async(struct scsi_devic
 	sioc->data = privdata;
 	sioc->done = done;
 
-	blk_execute_rq_nowait(req->q, NULL, req, 1, scsi_end_async);
+	blk_execute_rq_nowait(req->q, NULL, req, 0, scsi_end_async);
 	return 0;
 
 free_req:
Signature · 2 lines
Dan Aloni
XIV, http://www.xivstorage.com
#1 lore raw
Quoted 5 lines · Dan Aloni

Hello,

scsi_execute_async() has replaced scsi_do_req() a few versions ago, but it also incurred a change of behavior. I noticed that over-queuing a SCSI device using that function causes I/Os to be starved from low-level queuing for no justified reason.

I think it makes much more sense to perserve the original behaviour of scsi_do_req() and add the request to the tail of the queue.

As far as I'm aware the way in which scsi_do_req() was to insert at the head of the queue, leading to projects like SCST to come up with scsi_do_req_fifo() as queuing multiple commands using scsi_do_req() with constant head insertion might lead to out of order execution.

Just thought I'd throw some light on the history and what others have done in the past.

Steve

author
#2 lore raw
Quoted 11 lines · Steven Hayter
Quoted 5 lines · Dan Aloni

Hello,

scsi_execute_async() has replaced scsi_do_req() a few versions ago, but it also incurred a change of behavior. I noticed that over-queuing a SCSI device using that function causes I/Os to be starved from low-level queuing for no justified reason.

I think it makes much more sense to perserve the original behaviour of scsi_do_req() and add the request to the tail of the queue.

As far as I'm aware the way in which scsi_do_req() was to insert at the head of the queue, leading to projects like SCST to come up with scsi_do_req_fifo() as queuing multiple commands using scsi_do_req() with constant head insertion might lead to out of order execution.

Just thought I'd throw some light on the history and what others have done in the past.

In Linux 2.4.31 scsi_do_req() still inserts at the tail. This was also valid until 2.6.5. James, is the change you inserted in Linux 2.6.5 still relevant in 2.6 today?

<[email protected]>
[PATCH] add device quiescing to the SCSI API

This patch adds the ability to quiesce a SCSI device. The idea
is that
user issued commands (including filesystem ones) would get blocked, while mid-layer and device issued ones would be allowed to proceed. This is for things like Domain Validation which like to operate
on an
otherwise quiet device.

There is one big change: to get all of this to happen correctly, scsi_do_req() has to queue on the *head* of the request queue,
not the
tail as it was doing previously. The reason is that deferred
requests
block the queue, so anything needing executing after a deferred
request
has to go in front of it. I don't think there are any untoward consequences of this.

Signature · 3 lines
Dan Aloni
XIV LTD, http://www.xivstorage.com
da-x (at) monatomic.org, dan (at) xiv.co.il