Skip to contentSkip to conversation

2.6.11-ck6

DISCUSSION Con Kolivas 2 participants 6 messages Apr 30, 2005 – May 1, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

These are patches designed to improve system responsiveness. It is configurable to any workload but the default ck* patch is aimed at the desktop and ck*-server is available with more emphasis on serverspace.

Apply to 2.6.11 (already contains latest 4 point stable release):
http://ck.kolivas.org/patches/2.6/2.6.11/2.6.11-ck6/patch-2.6.11-ck6.bz2
or
http://ck.kolivas.org/patches/2.6/2.6.11/2.6.11-ck6/patch-2.6.11-ck6-server.bz2

web:
http://kernel.kolivas.org
all patches:
http://ck.kolivas.org/patches/
Split patches available.

Changes since 2.6.11-ck4 (last public announcement):
Added:
+2.6.11-ck4_to_staircase11.diff
Update to new version of staircase announced on mailing list +s11_s11.1.diff
New staircase specific scalability improvements

+scsi-dead-device.diff
A fix for a scsi related hang that seems to hit many -ck users

+patch-2.6.11.8
Latest stable tree

+2611ck6-version.diff
Reinstate the Australian animal that's woozy from cognac

Removed:
-patch-2.6.11.7
-2611ck4-version.diff

And don't forget to pour one of these before booting this kernel:
http://ck.kolivas.org/patches/2.6/2.6.11/cognac.JPG

Cheers,
Con

#1 lore raw
Quoted 2 lines · Con Kolivas

+scsi-dead-device.diff
A fix for a scsi related hang that seems to hit many -ck users

This looks strange, like a fix and a half. You should just apply the patch I sent you originally, weeks ago, changing sdev->sdev_lock to &q->__queue_lock.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 7 lines · Jens Axboe
Quoted 2 lines · Con Kolivas

+scsi-dead-device.diff
A fix for a scsi related hang that seems to hit many -ck users

This looks strange, like a fix and a half. You should just apply the patch I sent you originally, weeks ago, changing sdev->sdev_lock to &q->__queue_lock.

rarrgh

Thanks for keeping an eye out on for this. Unfortunately you sent more than one patch at different times and it looks like I included the wrong one then? This is the patch I (tried to) include.

Con

===== drivers/scsi/scsi_lib.c 1.151 vs edited =====

drivers/scsi/scsi_lib.c +24 -1
@@ -1233,6 +1233,22 @@ static inline int scsi_host_queue_ready(
 }
 
 /*
+ * Kill requests for a dead device
+ */
+static void scsi_kill_requests(request_queue_t *q)
+{
+	struct request *req;
+
+	while ((req = elv_next_request(q)) != NULL) {
+		blkdev_dequeue_request(req);
+		req->flags |= REQ_QUIET;
+		while (end_that_request_first(req, 0, req->nr_sectors))
+			;
+		end_that_request_last(req);
+	}
+}
+
+/*
  * Function:    scsi_request_fn()
  *
  * Purpose:     Main strategy routine for SCSI.
@@ -1246,10 +1262,16 @@ static inline int scsi_host_queue_ready(
 static void scsi_request_fn(struct request_queue *q)
 {
 	struct scsi_device *sdev = q->queuedata;
-	struct Scsi_Host *shost = sdev->host;
+	struct Scsi_Host *shost;
 	struct scsi_cmnd *cmd;
 	struct request *req;
 
+	if (!sdev) {
+		printk("scsi: killing requests for dead queue\n");
+		scsi_kill_requests(q);
+		return;
+	}
+
 	if(!get_device(&sdev->sdev_gendev))
 		/* We must be tearing the block queue down already */
 		return;
@@ -1258,6 +1280,7 @@ static void scsi_request_fn(struct reque
 	 * To start with, we keep looping until the queue is empty, or until
 	 * the host is no longer able to accept any more requests.
 	 */
+	shost = sdev->host;
 	while (!blk_queue_plugged(q)) {
 		int rtn;
 		/*

===== drivers/scsi/scsi_sysfs.c 1.69 vs edited =====

drivers/scsi/scsi_sysfs.c +3 -1
@@ -168,8 +168,10 @@ void scsi_device_dev_release(struct devi
 	list_del(&sdev->starved_entry);
 	spin_unlock_irqrestore(sdev->host->host_lock, flags);
 
-	if (sdev->request_queue)
+	if (sdev->request_queue) {
+		sdev->request_queue->queuedata = NULL;
 		scsi_free_queue(sdev->request_queue);
+	}
 
 	scsi_target_reap(scsi_target(sdev));
 
#3 lore raw
Quoted 9 lines · Con Kolivas
Quoted 7 lines · Jens Axboe
Quoted 2 lines · Con Kolivas

+scsi-dead-device.diff
A fix for a scsi related hang that seems to hit many -ck users

This looks strange, like a fix and a half. You should just apply the patch I sent you originally, weeks ago, changing sdev->sdev_lock to &q->__queue_lock.

Quoted 5 lines

rarrgh

Thanks for keeping an eye out on for this. Unfortunately you sent more than one patch at different times and it looks like I included the wrong one then? This is the patch I (tried to) include.

I guess from your description this was the one I should have included... Looks like a ck7 should come out instead since that other patch was more likely harmful than not :\

Con

===== drivers/block/ll_rw_blk.c 1.288 vs edited =====

drivers/block/ll_rw_blk.c +9 -0
@@ -1714,6 +1711,15 @@ request_queue_t *blk_init_queue(request_
 	if (blk_init_free_list(q))
 		goto out_init;
 
+	/*
+	 * if caller didn't supply a lock, they get per-queue locking with
+	 * our embedded lock
+	 */
+	if (!lock) {
+		spin_lock_init(&q->__queue_lock);
+		lock = &q->__queue_lock;
+	}
+
 	q->request_fn		= rfn;
 	q->back_merge_fn       	= ll_back_merge_fn;
 	q->front_merge_fn      	= ll_front_merge_fn;

===== drivers/scsi/scsi_lib.c 1.153 vs edited =====

drivers/scsi/scsi_lib.c +3 -3
@@ -360,9 +360,9 @@ void scsi_device_unbusy(struct scsi_devi
 		     shost->host_failed))
 		scsi_eh_wakeup(shost);
 	spin_unlock(shost->host_lock);
-	spin_lock(&sdev->sdev_lock);
+	spin_lock(sdev->request_queue->queue_lock);
 	sdev->device_busy--;
-	spin_unlock_irqrestore(&sdev->sdev_lock, flags);
+	spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
 }
 
 /*
@@ -1425,7 +1425,7 @@ struct request_queue *scsi_alloc_queue(s
 	struct Scsi_Host *shost = sdev->host;
 	struct request_queue *q;
 
-	q = blk_init_queue(scsi_request_fn, &sdev->sdev_lock);
+	q = blk_init_queue(scsi_request_fn, NULL);
 	if (!q)
 		return NULL;
 

===== drivers/scsi/scsi_scan.c 1.143 vs edited =====

drivers/scsi/scsi_scan.c +0 -1
@@ -249,7 +249,6 @@ static struct scsi_device *scsi_alloc_sd
 	 */
 	sdev->borken = 1;
 
-	spin_lock_init(&sdev->sdev_lock);
 	sdev->request_queue = scsi_alloc_queue(sdev);
 	if (!sdev->request_queue) {
 		/* release fn is set up in scsi_sysfs_device_initialise, so

===== include/linux/blkdev.h 1.162 vs edited =====

include/linux/blkdev.h +4 -1
@@ -355,8 +364,11 @@ struct request_queue
 	unsigned long		queue_flags;
 
 	/*
-	 * protects queue structures from reentrancy
+	 * protects queue structures from reentrancy. ->__queue_lock should
+	 * _never_ be used directly, it is queue private. always use
+	 * ->queue_lock.
 	 */
+	spinlock_t		__queue_lock;
 	spinlock_t		*queue_lock;
 
 	/*

===== include/scsi/scsi_device.h 1.33 vs edited =====

include/scsi/scsi_device.h +0 -1
@@ -44,7 +44,6 @@ struct scsi_device {
 	struct list_head    same_target_siblings; /* just the devices sharing same target id */
 
 	volatile unsigned short device_busy;	/* commands actually active on low-level */
-	spinlock_t sdev_lock;           /* also the request queue_lock */
 	spinlock_t list_lock;
 	struct list_head cmd_list;	/* queue of in use SCSI Command structures */
 	struct list_head starved_entry;
#5 lore raw
In reply to Con Kolivas
Quoted 12 lines · Con Kolivas
Quoted 11 lines · Con Kolivas
Quoted 7 lines · Jens Axboe
Quoted 2 lines · Con Kolivas

+scsi-dead-device.diff
A fix for a scsi related hang that seems to hit many -ck users

This looks strange, like a fix and a half. You should just apply the patch I sent you originally, weeks ago, changing sdev->sdev_lock to &q->__queue_lock.

rarrgh

Quoted 7 lines
Quoted 3 lines

Thanks for keeping an eye out on for this. Unfortunately you sent more than one patch at different times and it looks like I included the wrong one then? This is the patch I (tried to) include.

I guess from your description this was the one I should have included... Looks like a ck7 should come out instead since that other patch was more likely harmful than not :\

Yep, that is the correct patch. The other one wont do any further harm, it just wont fix the problem fully.

Signature · 1 line
Jens Axboe