From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: arjan@linux.intel.com, rusty@rustcorp.com.au
Subject: + modules-extend-initcall_debug-functionality-to-the-module-loader.patch added to -mm tree
Date: Thu, 17 Jul 2008 17:08:38 -0700 [thread overview]
Message-ID: <200807180008.m6I08cXA014153@imap1.linux-foundation.org> (raw)
The patch titled
modules: extend initcall_debug functionality to the module loader
has been added to the -mm tree. Its filename is
modules-extend-initcall_debug-functionality-to-the-module-loader.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: modules: extend initcall_debug functionality to the module loader
From: Arjan van de Ven <arjan@linux.intel.com>
The kernel has this really nice facility where if you put "initcall_debug"
on the kernel commandline, it'll print which function it's going to
execute just before calling an initcall, and then after the call completes
it will
1) print if it had an error code
2) checks for a few simple bugs (like leaving irqs off)
and
3) print how long the init call took in milliseconds.
While trying to optimize the boot speed of my laptop, I have been loving
number 3 to figure out what to optimize... ... and then I wished that
the same thing was done for module loading.
This patch makes the module loader use this exact same functionality; it's
a logical extension in my view (since modules are just sort of late
binding initcalls anyway) and so far I've found it quite useful in finding
where things are too slow in my boot.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/init.h | 1 +
init/main.c | 6 ++++--
kernel/module.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff -puN include/linux/init.h~modules-extend-initcall_debug-functionality-to-the-module-loader include/linux/init.h
--- a/include/linux/init.h~modules-extend-initcall_debug-functionality-to-the-module-loader
+++ a/include/linux/init.h
@@ -143,6 +143,7 @@ extern char __initdata boot_command_line
extern char *saved_command_line;
extern unsigned int reset_devices;
extern int initmem_now_dynamic;
+extern int do_one_initcall(initcall_t fn);
/* used by init/main.c */
void setup_arch(char **);
diff -puN init/main.c~modules-extend-initcall_debug-functionality-to-the-module-loader init/main.c
--- a/init/main.c~modules-extend-initcall_debug-functionality-to-the-module-loader
+++ a/init/main.c
@@ -694,7 +694,7 @@ asmlinkage void __init start_kernel(void
rest_init();
}
-static int __initdata initcall_debug;
+static int initcall_debug;
static int __init initcall_debug_setup(char *str)
{
@@ -703,7 +703,7 @@ static int __init initcall_debug_setup(c
}
__setup("initcall_debug", initcall_debug_setup);
-static void __init do_one_initcall(initcall_t fn)
+int do_one_initcall(initcall_t fn)
{
int count = preempt_count();
ktime_t t0, t1, delta;
@@ -743,6 +743,8 @@ static void __init do_one_initcall(initc
print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn);
printk(" returned with %s\n", msgbuf);
}
+
+ return result;
}
diff -puN kernel/module.c~modules-extend-initcall_debug-functionality-to-the-module-loader kernel/module.c
--- a/kernel/module.c~modules-extend-initcall_debug-functionality-to-the-module-loader
+++ a/kernel/module.c
@@ -2288,7 +2288,7 @@ sys_init_module(void __user *umod,
/* Start the module */
if (mod->init != NULL)
- ret = mod->init();
+ ret = do_one_initcall(mod->init);
if (ret < 0) {
/* Init routine failed: abort. Try to protect us from
buggy refcounters. */
_
Patches currently in -mm which might be from arjan@linux.intel.com are
origin.patch
linux-next.patch
via-velocity-fix-sleep-with-spinlock-bug-during-mtu-change.patch
modules-extend-initcall_debug-functionality-to-the-module-loader.patch
rename-warn-to-warning-to-clear-the-namespace.patch
add-a-warn-macro-this-is-warn_on-printk-arguments.patch
kernel-irq-managec-replace-a-printk-warn_on-to-a-warn.patch
example-use-of-warn.patch
use-warn-in-kernel-irq-managec.patch
use-warn-in-mm-vmallocc.patch
use-warn-in-kernel-lockdepc.patch
use-warn-in-kernel-irq-chipc.patch
use-warn-in-arch-x86-mm-ioremapc.patch
use-warn-in-arch-x86-mm-pageattrc.patch
use-warn-in-arch-x86-kernel.patch
use-warn-in-block.patch
use-warn-in-drivers-base.patch
use-warn-in-lib.patch
use-warn-in-fs.patch
usr-warn-in-fs-sysfs.patch
use-warn-in-fs-proc.patch
next reply other threads:[~2008-07-18 0:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 0:08 akpm [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-07-17 23:32 + modules-extend-initcall_debug-functionality-to-the-module-loader.patch added to -mm tree akpm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200807180008.m6I08cXA014153@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox