diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 01:10:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 01:10:26 -0500 |
commit | ece8e0b2f9c980e5511fe8db2d68c6f1859b9d83 (patch) | |
tree | 70f1e3363080884965686576d079d24da8863a58 /init | |
parent | 67cb104b4c30bd52292b6a7f526349aab2dd5cbd (diff) | |
parent | a0327ff0eda915be623658babacef706099c11a8 (diff) |
Merge branch 'for-3.9-async' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull async changes from Tejun Heo:
"These are followups for the earlier deadlock issue involving async
ending up waiting for itself through block requesting module[1]. The
following changes are made by these commits.
- Instead of requesting default elevator on each request_queue init,
block now requests it once early during boot.
- Kmod triggers warning if invoked from an async worker.
- Async synchronization implementation has been reimplemented. It's
a lot simpler now."
* 'for-3.9-async' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
async: initialise list heads to fix crash
async: replace list of active domains with global list of pending items
async: keep pending tasks on async_domain and remove async_pending
async: use ULLONG_MAX for infinity cookie value
async: bring sanity to the use of words domain and running
async, kmod: warn on synchronous request_module() from async workers
block: don't request module during elevator init
init, block: try to load default elevator module early during boot
Diffstat (limited to 'init')
-rw-r--r-- | init/do_mounts_initrd.c | 3 | ||||
-rw-r--r-- | init/initramfs.c | 8 | ||||
-rw-r--r-- | init/main.c | 16 |
3 files changed, 26 insertions, 1 deletions
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index f9acf71b9810..a32ec1ce882b 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c | |||
@@ -61,6 +61,9 @@ static void __init handle_initrd(void) | |||
61 | sys_mkdir("/old", 0700); | 61 | sys_mkdir("/old", 0700); |
62 | sys_chdir("/old"); | 62 | sys_chdir("/old"); |
63 | 63 | ||
64 | /* try loading default modules from initrd */ | ||
65 | load_default_modules(); | ||
66 | |||
64 | /* | 67 | /* |
65 | * In case that a resume from disk is carried out by linuxrc or one of | 68 | * In case that a resume from disk is carried out by linuxrc or one of |
66 | * its children, we need to tell the freezer not to wait for us. | 69 | * its children, we need to tell the freezer not to wait for us. |
diff --git a/init/initramfs.c b/init/initramfs.c index 84c6bf111300..a67ef9dbda9d 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -592,7 +592,7 @@ static int __init populate_rootfs(void) | |||
592 | initrd_end - initrd_start); | 592 | initrd_end - initrd_start); |
593 | if (!err) { | 593 | if (!err) { |
594 | free_initrd(); | 594 | free_initrd(); |
595 | return 0; | 595 | goto done; |
596 | } else { | 596 | } else { |
597 | clean_rootfs(); | 597 | clean_rootfs(); |
598 | unpack_to_rootfs(__initramfs_start, __initramfs_size); | 598 | unpack_to_rootfs(__initramfs_start, __initramfs_size); |
@@ -607,6 +607,7 @@ static int __init populate_rootfs(void) | |||
607 | sys_close(fd); | 607 | sys_close(fd); |
608 | free_initrd(); | 608 | free_initrd(); |
609 | } | 609 | } |
610 | done: | ||
610 | #else | 611 | #else |
611 | printk(KERN_INFO "Unpacking initramfs...\n"); | 612 | printk(KERN_INFO "Unpacking initramfs...\n"); |
612 | err = unpack_to_rootfs((char *)initrd_start, | 613 | err = unpack_to_rootfs((char *)initrd_start, |
@@ -615,6 +616,11 @@ static int __init populate_rootfs(void) | |||
615 | printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); | 616 | printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); |
616 | free_initrd(); | 617 | free_initrd(); |
617 | #endif | 618 | #endif |
619 | /* | ||
620 | * Try loading default modules from initramfs. This gives | ||
621 | * us a chance to load before device_initcalls. | ||
622 | */ | ||
623 | load_default_modules(); | ||
618 | } | 624 | } |
619 | return 0; | 625 | return 0; |
620 | } | 626 | } |
diff --git a/init/main.c b/init/main.c index cee4b5c66d81..63534a141b4e 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -70,6 +70,8 @@ | |||
70 | #include <linux/perf_event.h> | 70 | #include <linux/perf_event.h> |
71 | #include <linux/file.h> | 71 | #include <linux/file.h> |
72 | #include <linux/ptrace.h> | 72 | #include <linux/ptrace.h> |
73 | #include <linux/blkdev.h> | ||
74 | #include <linux/elevator.h> | ||
73 | 75 | ||
74 | #include <asm/io.h> | 76 | #include <asm/io.h> |
75 | #include <asm/bugs.h> | 77 | #include <asm/bugs.h> |
@@ -794,6 +796,17 @@ static void __init do_pre_smp_initcalls(void) | |||
794 | do_one_initcall(*fn); | 796 | do_one_initcall(*fn); |
795 | } | 797 | } |
796 | 798 | ||
799 | /* | ||
800 | * This function requests modules which should be loaded by default and is | ||
801 | * called twice right after initrd is mounted and right before init is | ||
802 | * exec'd. If such modules are on either initrd or rootfs, they will be | ||
803 | * loaded before control is passed to userland. | ||
804 | */ | ||
805 | void __init load_default_modules(void) | ||
806 | { | ||
807 | load_default_elevator_module(); | ||
808 | } | ||
809 | |||
797 | static int run_init_process(const char *init_filename) | 810 | static int run_init_process(const char *init_filename) |
798 | { | 811 | { |
799 | argv_init[0] = init_filename; | 812 | argv_init[0] = init_filename; |
@@ -900,4 +913,7 @@ static noinline void __init kernel_init_freeable(void) | |||
900 | * we're essentially up and running. Get rid of the | 913 | * we're essentially up and running. Get rid of the |
901 | * initmem segments and start the user-mode stuff.. | 914 | * initmem segments and start the user-mode stuff.. |
902 | */ | 915 | */ |
916 | |||
917 | /* rootfs is available now, try loading default modules */ | ||
918 | load_default_modules(); | ||
903 | } | 919 | } |