public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: Multiprobe sanitizer
@ 2006-08-16 16:42 Alan Cox
  2006-08-16 22:26 ` Greg KH
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Cox @ 2006-08-16 16:42 UTC (permalink / raw)
  To: akpm, linux-kernel

There are numerous drivers that can use multithreaded probing but having
some kind of global flag as the way to control this makes migration to
threaded probing hard and since it enables it everywhere and is almost
as likely to cause serious pain as holding a clog dance in a minefield.

If we have a pci_driver multithread_probe flag to inherit you can turn
it on for one driver at a time. 

>From playing so far however I think we need a different model at the
device layer which serializes until the called probe function says "ok
you can start another one now". That would need some kind of flag and
semaphore plus a helper function.

Anyway in the absence of that this is a starting point to usefully play
with this stuff

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc4-mm1/drivers/pci/pci-driver.c linux-2.6.18-rc4-mm1/drivers/pci/pci-driver.c
--- linux.vanilla-2.6.18-rc4-mm1/drivers/pci/pci-driver.c	2006-08-15 15:40:17.000000000 +0100
+++ linux-2.6.18-rc4-mm1/drivers/pci/pci-driver.c	2006-08-15 17:24:44.000000000 +0100
@@ -432,7 +432,11 @@
 	drv->driver.bus = &pci_bus_type;
 	drv->driver.owner = owner;
 	drv->driver.kobj.ktype = &pci_driver_kobj_type;
-	drv->driver.multithread_probe = pci_multithread_probe;
+	
+	if(pci_multithread_probe)
+		drv->driver.multithread_probe = pci_multithread_probe;
+	else
+		drv->driver.multithread_probe = drv->multithread_probe;
 
 	spin_lock_init(&drv->dynids.lock);
 	INIT_LIST_HEAD(&drv->dynids.list);
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc4-mm1/include/linux/pci.h linux-2.6.18-rc4-mm1/include/linux/pci.h
--- linux.vanilla-2.6.18-rc4-mm1/include/linux/pci.h	2006-08-15 15:40:19.000000000 +0100
+++ linux-2.6.18-rc4-mm1/include/linux/pci.h	2006-08-15 16:37:21.000000000 +0100
@@ -351,6 +351,8 @@
 	struct pci_error_handlers *err_handler;
 	struct device_driver	driver;
 	struct pci_dynids dynids;
+	
+	int multithread_probe;
 };
 
 #define	to_pci_driver(drv) container_of(drv,struct pci_driver, driver)


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

end of thread, other threads:[~2006-08-17 15:48 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-16 16:42 PATCH: Multiprobe sanitizer Alan Cox
2006-08-16 22:26 ` Greg KH
2006-08-17  0:36   ` Alan Cox
2006-08-17  6:57     ` Benjamin Herrenschmidt
2006-08-17  7:00       ` Arjan van de Ven
2006-08-17  8:41       ` Alan Cox
2006-08-17  9:24         ` Benjamin Herrenschmidt
2006-08-17 12:00           ` Greg KH
2006-08-17 12:12             ` Benjamin Herrenschmidt
2006-08-17 12:22               ` Greg KH
2006-08-17 12:37                 ` Benjamin Herrenschmidt
2006-08-17 13:04                   ` Arjan van de Ven
2006-08-17 13:10                     ` Benjamin Herrenschmidt
2006-08-17 15:44                     ` Greg KH
2006-08-17 14:43                 ` Olaf Hering
2006-08-17 15:42                   ` Greg KH
2006-08-17 11:58     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox