mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kobject: don't block for each kobject_uevent
@ 2009-03-19 16:09 Arjan van de Ven
  2009-03-20  0:11 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Arjan van de Ven @ 2009-03-19 16:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, akpm

>From d44701ae98a2c43a898dd7a7765d8894fd2e6caa Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Thu, 19 Mar 2009 09:02:17 -0700
Subject: [PATCH] kobject: don't block for each kobject_uevent

Right now, the kobject_uevent code blocks for each uevent that's being generated,
due to using (for hystoric reasons) UHM_WAIT_EXEC as flag to call_usermode_helper().
Specifically, the effect is that each uevent that is being sent causes the code to
wake up keventd, then block until keventd has processed the work. Needless to say,
this happens many times during the system boot.

This patches changes that to UHN_NO_WAIT (brilliant name for a constant btw) so
that we only schedule the work to fire the uevent message, but do not wait for
keventd to process the work.

This removes one of the bottlenecks during boot; each one of them is only a small
effect, but the sum of them does add up.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 lib/kobject_uevent.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 318328d..0b63523 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -248,7 +248,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
 			goto exit;
 
 		retval = call_usermodehelper(argv[0], argv,
-					     env->envp, UMH_WAIT_EXEC);
+					     env->envp, UMH_NO_WAIT);
 	}
 
 exit:
-- 
1.6.0.6



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

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

end of thread, other threads:[~2009-03-20  0:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19 16:09 [PATCH] kobject: don't block for each kobject_uevent Arjan van de Ven
2009-03-20  0:11 ` Greg KH

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

all inboxes | Powered by JetHome®