[launchd-changes] [23199] trunk/launchd/src

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 2 14:32:00 PDT 2007


Revision: 23199
          http://trac.macosforge.org/projects/launchd/changeset/23199
Author:   zarzycki at apple.com
Date:     2007-04-02 14:31:59 -0700 (Mon, 02 Apr 2007)

Log Message:
-----------
<rdar://problem/5066316> The IOKit team would like kextd to get a head start on all the other daemons at boot up

Modified Paths:
--------------
    trunk/launchd/src/launchctl.c
    trunk/launchd/src/launchd_core_logic.c

Modified: trunk/launchd/src/launchctl.c
===================================================================
--- trunk/launchd/src/launchctl.c	2007-04-02 20:43:42 UTC (rev 23198)
+++ trunk/launchd/src/launchctl.c	2007-04-02 21:31:59 UTC (rev 23199)
@@ -1380,6 +1380,51 @@
 
 	assumes(load_and_unload_cmd(4, load_launchd_items) == 0);
 
+	/*
+	 * 5066316
+	 *
+	 * We need to revisit this after Leopard ships.
+	 *
+	 * I want a plist defined knob for jobs to give advisory hints that
+	 * will "hopefully" serialize bootstrap. Reasons for doing so include
+	 * pragmatic performance optimizations and attempts to workaround bugs
+	 * in jobs. My current thought is something like what follows.
+	 *
+	 * The BootCache would switch to launchd and add this to the plist:
+	 *
+	 * <key>HopefullyStartsSerially<key>
+	 * <dict>
+	 * 	<key>ReadyTimeout</key>
+	 * 	<integer>2</integer>
+	 * </dict>
+	 *
+	 * And kextd would add the following:
+	 *
+	 * <key>HopefullyStartsSerially<key>
+	 * <dict>
+	 * 	<key>ReadyTimeout</key>
+	 * 	<integer>5</integer>
+	 * 	<key>HopefullyStartsAfter</key>
+	 * 	<string>com.apple.BootCache.daemon</string>
+	 * </dict>
+	 *
+	 *
+	 * Then both the BootCache and kextd could call something like:
+	 *
+	 * vproc_declare_ready_state();
+	 *
+	 * To tell launchd to short circuit the readiness timeout and let the
+	 * next wave of jobs start.
+	 *
+	 * Yes, this mechanism smells a lot like SystemStarter, rc.d and
+	 * friends. I think as long as we document that artificial
+	 * serialization is only advisory and not guaranteed, we should be
+	 * fine. Remember: IPC is the preferred way to serialize operations.
+	 *
+	 */
+	mach_timespec_t w = { 5, 0 };
+	IOKitWaitQuiet(kIOMasterPortDefault, &w);
+
 	do_BootCache_magic(BOOTCACHE_TAG);
 
 	do_bootroot_magic();

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2007-04-02 20:43:42 UTC (rev 23198)
+++ trunk/launchd/src/launchd_core_logic.c	2007-04-02 21:31:59 UTC (rev 23199)
@@ -3112,7 +3112,13 @@
 	struct stat sb;
 	bool good_exit = (WIFEXITED(j->last_exit_status) && WEXITSTATUS(j->last_exit_status) == 0);
 
-	if (j->mgr->global_on_demand_cnt > 0) {
+	/*
+	 * 5066316
+	 *
+	 * We definitely need to revisit this after Leopard ships. Please see
+	 * launchctl.c for the other half of this hack.
+	 */
+	if (j->mgr->global_on_demand_cnt > 0 && strcmp(j->label, "com.apple.kextd") != 0) {
 		return false;
 	}
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070402/3a9a5dba/attachment.html


More information about the launchd-changes mailing list