Skip to contentSkip to conversation

Remove SCSI_BH

PATCH In review Matthew Wilcox 2 participants 3 messages Jun 16, 2002 – Jun 17, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove SCSI_BH

Hi, Linus. This patch switches SCSI from a bottom half to a tasklet. It's been reviewed, tested & approved by Andrew Morton, James Bottomley & Doug Gilbert. Please apply.

drivers/scsi/scsi.c +6 -8
@@ -1090,6 +1090,9 @@
 	SCSI_LOG_MLQUEUE(3, printk("Leaving scsi_do_cmd()\n"));
 }
 
+void scsi_tasklet_func(unsigned long);
+static DECLARE_TASKLET(scsi_tasklet, scsi_tasklet_func, 0);
+
 /*
  * This function is the mid-level interrupt routine, which decides how
  *  to handle error conditions.  Each invocation of this function must
@@ -1187,7 +1190,7 @@
 	/*
 	 * Mark the bottom half handler to be run.
 	 */
-	mark_bh(SCSI_BH);
+	tasklet_hi_schedule(&scsi_tasklet);
 }
 
 /*
@@ -1213,7 +1216,7 @@
  * half queue.  Thus the only time we hold the lock here is when
  * we wish to atomically remove the contents of the queue.
  */
-void scsi_bottom_half_handler(void)
+void scsi_tasklet_func(unsigned long ignore)
 {
 	Scsi_Cmnd *SCpnt;
 	Scsi_Cmnd *SCnext;
@@ -2545,11 +2548,6 @@
         if (scsihosts)
 		printk(KERN_INFO "scsi: host order: %s\n", scsihosts);	
 	scsi_host_no_init (scsihosts);
-	/*
-	 * This is where the processing takes place for most everything
-	 * when commands are completed.
-	 */
-	init_bh(SCSI_BH, scsi_bottom_half_handler);
 
 	return 0;
 }
@@ -2559,7 +2557,7 @@
 	Scsi_Host_Name *shn, *shn2 = NULL;
 	int i;
 
-	remove_bh(SCSI_BH);
+	tasklet_kill(&scsi_tasklet);
 
         devfs_unregister (scsi_devfs_handle);
         for (shn = scsi_host_no_list;shn;shn = shn->next) {
Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw

From: Matthew Wilcox <[email protected]>
Date: Sun, 16 Jun 2002 19:22:53 +0100

Hi, Linus. This patch switches SCSI from a bottom half to a tasklet. It's been reviewed, tested & approved by Andrew Morton, James Bottomley & Doug Gilbert. Please apply.

I always wanted to make this a per-cpu SOFTIRQ, there is no reason it can't be and it's important enough to deserve to be one.

#2 lore raw
Quoted 9 lines · David S. Miller

From: Matthew Wilcox <[email protected]>
Date: Sun, 16 Jun 2002 19:22:53 +0100

Hi, Linus. This patch switches SCSI from a bottom half to a tasklet. It's been reviewed, tested & approved by Andrew Morton, James Bottomley & Doug Gilbert. Please apply.

I always wanted to make this a per-cpu SOFTIRQ, there is no reason it can't be and it's important enough to deserve to be one.

I agree that it probably should become a softirq. However, in its current state, I'm not sure it would gain any advantage from becoming a softirq. I think it would take someone with far more understanding of the SCSI layer than I have to do this work properly. My current motivation is to eradicate bottom halves rather than to improve scsi.

If someone's maintaining a TODO list for the scsi subsystem, please include:

* Convert scsi_bottom_half_handler to a softirq.

as one of the entries.

Signature · 1 line
Revolutions do not require corporate support.