driver core: remove polling for driver_probe_done(v3)
Subsystems (2)
PATCH 1/1 driver core: remove polling for driver_probe_done(v3)
From: Ming Lei <[email protected]>
This patch adds a function : driver_wait_probe_done, which waits on condition of probing done to replace polling for driver_probe_done in fs initialization.
There is no better way to avoid polling for driver_probe_done _and_ existence of the root device, so we does not replace the driver_probe_done with driver_wait_probe_done in such special case.
Removing polling in fs initialization may lead to a faster boot.
--- drivers/base/dd.c | 12 ++++++++++++ include/linux/device.h | 1 + init/do_mounts.c | 4 ++-- init/do_mounts_md.c | 3 +-- 4 files changed, 16 insertions(+), 4 deletions(-)
drivers/base/dd.c +12 -0
@@ -168,6 +168,18 @@ int driver_probe_done(void) }/** +* driver_wait_probe_done +* Wait until the probe sequence is finished. +* +*/ +void driver_wait_probe_done (void ) +{ +pr_debug ("%s: probe_count = %d\n" , __func__, +atomic_read (&probe_count)); +wait_event (probe_waitqueue,atomic_read (&probe_count) ==0 ); +} + +/** * driver_probe_device - attempt to bind device & driver together * @drv: driver to bind a device to * @dev: device to try to bind to the driver
include/linux/device.h +1 -0
@@ -147,6 +147,7 @@ extern void put_driver(struct device_driver *drv);extern struct device_driver *driver_find (const char *name,struct bus_type *bus);extern int driver_probe_done (void ); +extern void driver_wait_probe_done (void );/* sysfs interface for exporting driver attributes */
init/do_mounts.c +2 -2
@@ -371,8 +371,8 @@ void __init prepare_namespace(void) }/* wait for the known devices to complete their probing */ -while (driver_probe_done () !=0 ) -msleep (100 ); +driver_wait_probe_done (); +async_synchronize_full ();md_run_setup ();
init/do_mounts_md.c +1 -2
@@ -281,8 +281,7 @@ static void __init autodetect_raid(void)*/ printk (KERN_INFO "md: Waiting for all devices to be available before autodetect\n" );printk (KERN_INFO "md: If you don't use raid, use raid=noautodetect\n" ); -while (driver_probe_done () <0 ) -msleep (100 ); +driver_wait_probe_done (); fd =sys_open ("/dev/md0" ,0 ,0 );if (fd >=0 ) {sys_ioctl (fd,RAID_AUTORUN , raid_autopart);
Signature · 1 line
1.6.0
Quoted 14 lines · On Fri, 30 Jan 2009 20:48:35 +0800, [email protected] wrote:
From: Ming Lei <[email protected]>
This patch adds a function :
driver_wait_probe_done, which waits on condition of probing done to replace polling fordriver_probe_donein fs initialization.There is no better way to avoid polling for
driver_probe_done_and_ existence of the root device, so we does not replace thedriver_probe_donewithdriver_wait_probe_donein such special case.Removing polling in fs initialization may lead to a faster boot.
Quoted 7 lines
Signed-off-by Ming Lei <[email protected]>--- drivers/base/dd.c | 12 ++++++++++++ include/linux/device.h | 1 + init/do_mounts.c | 4 ++-- init/do_mounts_md.c | 3 +-- 4 files changed, 16 insertions(+), 4 deletions(-)
Looks good and also survived a quick test on my s390 LPAR.
Quoted 11 lines · On Fri, 30 Jan 2009 20:48:35 +0800 [email protected] wrote:
From: Ming Lei <[email protected]>
This patch adds a function :
driver_wait_probe_done, which waits on condition of probing done to replace polling fordriver_probe_donein fs initialization.There is no better way to avoid polling for
driver_probe_done_and_ existence of the root device, so we does not replace thedriver_probe_donewithdriver_wait_probe_donein such special case.
Quoted 4 lines
Removing polling in fs initialization may lead to a faster boot.
Signed-off-by Ming Lei <[email protected]>
ok this one will work fine ;)
thanks for fixing this up
(it will clash with the patch that moves this to one place, but the same cleanup can be done there)
Signature · 3 lines
Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
Quoted 19 lines · Arjan van de Ven
Quoted 11 lines · On Fri, 30 Jan 2009 20:48:35 +0800 [email protected] wrote:
From: Ming Lei <[email protected]>
This patch adds a function :
driver_wait_probe_done, which waits on condition of probing done to replace polling fordriver_probe_donein fs initialization.There is no better way to avoid polling for
driver_probe_done_and_ existence of the root device, so we does not replace thedriver_probe_donewithdriver_wait_probe_donein such special case.Quoted 4 lines
Removing polling in fs initialization may lead to a faster boot.
Signed-off-by Ming Lei <[email protected]>
Quoted 7 lines
ok this one will work fine ;)
Reviewed-by Arjan van de Ven <[email protected]>thanks for fixing this up
(it will clash with the patch that moves this to one place, but the same cleanup can be done there)
What patch is that? Should i be taking this? Or are they in some other tree?
thanks,
greg k-h
Quoted 22 lines · On Wed, 4 Feb 2009 15:08:51 -0800 Greg KH <[email protected]> wrote:
Quoted 21 lines · Arjan van de Ven
Quoted 11 lines · On Fri, 30 Jan 2009 20:48:35 +0800 [email protected] wrote:
From: Ming Lei <[email protected]>
This patch adds a function :
driver_wait_probe_done, which waits on condition of probing done to replace polling fordriver_probe_donein fs initialization.There is no better way to avoid polling for
driver_probe_done_and_ existence of the root device, so we does not replace thedriver_probe_donewithdriver_wait_probe_donein such special case.Quoted 4 lines
Removing polling in fs initialization may lead to a faster boot.
Signed-off-by Ming Lei <[email protected]>ok this one will work fine ;)
Quoted 8 lines
Quoted 5 lines
Reviewed-by Arjan van de Ven <[email protected]>thanks for fixing this up
(it will clash with the patch that moves this to one place, but the same cleanup can be done there)What patch is that? Should i be taking this? Or are they in some other tree?
it's the suspend-resume regression fixes that either you already have or that raphael sent to you
Quoted 4 lines
thanks,
greg k-h
Signature · 3 lines
Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
Quoted 31 lines · Arjan van de Ven
Quoted 28 lines · On Wed, 4 Feb 2009 15:08:51 -0800 Greg KH <[email protected]> wrote:
Quoted 26 lines · Arjan van de Ven
Quoted 11 lines · On Fri, 30 Jan 2009 20:48:35 +0800 [email protected] wrote:
From: Ming Lei <[email protected]>
This patch adds a function :
driver_wait_probe_done, which waits on condition of probing done to replace polling fordriver_probe_donein fs initialization.There is no better way to avoid polling for
driver_probe_done_and_ existence of the root device, so we does not replace thedriver_probe_donewithdriver_wait_probe_donein such special case.Quoted 4 lines
Removing polling in fs initialization may lead to a faster boot.
Signed-off-by Ming Lei <[email protected]>ok this one will work fine ;)
Reviewed-by Arjan van de Ven <[email protected]>thanks for fixing this up
(it will clash with the patch that moves this to one place, but the same cleanup can be done there)
Quoted 5 lines
Quoted 2 lines
What patch is that? Should i be taking this? Or are they in some other tree?
it's the suspend-resume regression fixes that either you already have or that raphael sent to you
Hm, ok, I don't see any left in my tree, or queue, so perhaps someone might want to resend them to me?
thanks,
greg k-h
Hi, Greg
Would you mind queuing this patch into your tree?
Thanks!
2009/2/6 Greg KH <[email protected]>:
Quoted 45 lines · Arjan van de Ven
Quoted 31 lines
Quoted 28 lines · On Wed, 4 Feb 2009 15:08:51 -0800 Greg KH <[email protected]> wrote:
Quoted 26 lines · Arjan van de Ven
Quoted 11 lines · On Fri, 30 Jan 2009 20:48:35 +0800 [email protected] wrote:
From: Ming Lei <[email protected]>
This patch adds a function :
driver_wait_probe_done, which waits on condition of probing done to replace polling fordriver_probe_donein fs initialization.There is no better way to avoid polling for
driver_probe_done_and_ existence of the root device, so we does not replace thedriver_probe_donewithdriver_wait_probe_donein such special case.Quoted 4 lines
Removing polling in fs initialization may lead to a faster boot.
Signed-off-by Ming Lei <[email protected]>ok this one will work fine ;)
Reviewed-by Arjan van de Ven <[email protected]>thanks for fixing this up
(it will clash with the patch that moves this to one place, but the same cleanup can be done there)Quoted 5 lines
Quoted 2 lines
What patch is that? Should i be taking this? Or are they in some other tree?
it's the suspend-resume regression fixes that either you already have or that raphael sent to you
Hm, ok, I don't see any left in my tree, or queue, so perhaps someone might want to resend them to me?
thanks,
greg k-h
Signature · 1 line
Lei Ming
Quoted 2 lines · Ming Lei
Hi, Greg
Would you mind queuing this patch into your tree?
What patch? Did anyone resend it to me like I asked?
confused,
greg k-h
2009/2/17 Greg KH <[email protected]>:
Quoted 5 lines · Ming Lei
Quoted 2 lines
Hi, Greg
Would you mind queuing this patch into your tree?What patch? Did anyone resend it to me like I asked?
I mean the patch in the mail list,with the following subject:
[PATCH] driver core: remove polling for driver_probe_done(v3)
Thanks!
Quoted 5 lines
confused,
greg k-h
Signature · 1 line
Lei Ming
Quoted 10 lines · Ming Lei
2009/2/17 Greg KH <[email protected]>:
Quoted 5 lines · Ming Lei
Quoted 2 lines
Hi, Greg
Would you mind queuing this patch into your tree?What patch? Did anyone resend it to me like I asked?
I mean the patch in the mail list,with the following subject:
[PATCH] driver core: remove polling for
driver_probe_done(v3)
Care to resend it?