aboutsummaryrefslogtreecommitdiff
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2009-12-23 16:43:07 +0000
committerLeann Ogasawara <leann.ogasawara@canonical.com>2010-08-11 07:39:22 -0700
commit12cd640aa63d683e401615b73e3a90cb1ed39355 (patch)
tree798311e93c271e984aaf46c81ca031a592ad3f74 /init/initramfs.c
parent58eac50d52a97f6206f24ca76fed902c4b3e4677 (diff)
UBUNTU: SAUCE: async_populate_rootfs: move rootfs init earlier
Check to see if the machine has more than one active CPU, if it does then it is worth starting the decode of the rootfs earlier. Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 1a1be7a105e..8fed7ea0128 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -612,9 +612,22 @@ static void __init async_populate_rootfs(void)
return;
}
+static int __initdata rootfs_populated;
+
+static int __init populate_rootfs_early(void)
+{
+ if (num_online_cpus() > 1) {
+ rootfs_populated = 1;
+ async_schedule_domain(async_populate_rootfs, NULL,
+ &populate_rootfs_domain);
+ }
+}
static int __init populate_rootfs(void)
{
- async_schedule_domain(async_populate_rootfs, NULL, &populate_rootfs_domain);
+ if (!rootfs_populated)
+ async_schedule_domain(async_populate_rootfs, NULL,
+ &populate_rootfs_domain);
}
+earlyrootfs_initcall(populate_rootfs_early);
rootfs_initcall(populate_rootfs);