Skip to contentSkip to conversation

Kill SCSI_BH

PATCH Matthew Wilcox 4 participants 4 messages Jun 16, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

I'm not exactly clueful about the linux SCSI layer, but I'd really like to see old-style bottom halves die before 2.6. Is there any reason why SCSI_BH can't simply be comverted to a tasklet?

Andrew Morton kindly tested this patch for me and reports it works fine. I'd expect the Enterprise people to be thrilled by this as it increases scalability a touch (eg, SCSI handling is now not serialised against the serial port).

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
Quoted 4 lines · Matthew Wilcox

I'm not exactly clueful about the linux SCSI layer, but I'd really like to see old-style bottom halves die before 2.6. Is there any reason why SCSI_BH can't simply be comverted to a tasklet?

Probably just another linux scsi subsystem anachronism.

Quoted 4 lines

Andrew Morton kindly tested this patch for me and reports it works fine. I'd expect the Enterprise people to be thrilled by this as it increases scalability a touch (eg, SCSI handling is now not serialised against the serial port).

I applied the patch and it's running fine on this box. See how it goes with some stress testing. So far so go...

Doug Gilbert

#2 lore raw
In reply to Matthew Wilcox
Quoted 4 lines · [email protected] said:

Andrew Morton kindly tested this patch for me and reports it works fine. I'd expect the Enterprise people to be thrilled by this as it increases scalability a touch (eg, SCSI handling is now not serialised against the serial port).

It works fine for me on an 8-way box with SCSI root discs. Go ahead and send it to Linus as an obvious fix (given that the bottom half handlers are supposed to be deprecated). I've also stuck it in a public bitkeeper repository at:

http://linux-scsi.bkbits.net/scsi-mid-layer-2.5

James

#3 lore raw
In reply to Matthew Wilcox
Quoted 3 lines · Matthew Wilcox

I'm not exactly clueful about the linux SCSI layer, but I'd really like to see old-style bottom halves die before 2.6. Is there any reason why SCSI_BH can't simply be comverted to a tasklet?

Very nice.

Signature · 1 line
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.."