From 5c8806a037ad4f53259146060b32600566475e29 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Fri, 6 Jan 2012 15:10:44 -0800 Subject: rcu: Move RCU_TRACE to lib/Kconfig.debug The RCU_TRACE kernel parameter has always been intended for debugging, not for production use. Formalize this by moving RCU_TRACE from init/Kconfig to lib/Kconfig.debug. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- init/Kconfig | 9 --------- 1 file changed, 9 deletions(-) (limited to 'init') diff --git a/init/Kconfig b/init/Kconfig index 3f42cd66f0f8..72f33faca44f 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -438,15 +438,6 @@ config PREEMPT_RCU This option enables preemptible-RCU code that is common between the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. -config RCU_TRACE - bool "Enable tracing for RCU" - help - This option provides tracing in RCU which presents stats - in debugfs for debugging RCU implementation. - - Say Y here if you want to enable RCU tracing - Say N if you are unsure. - config RCU_FANOUT int "Tree-based hierarchical RCU fanout value" range 2 64 if 64BIT -- cgit v1.2.1 From bd2f55361f18347e890d52ff9cfd8895455ec11b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 21 Mar 2011 12:33:18 +0100 Subject: sched/rt: Use schedule_preempt_disabled() Coccinelle based conversion. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-24swm5zut3h9c4a6s46x8rws@git.kernel.org Signed-off-by: Ingo Molnar --- init/main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'init') diff --git a/init/main.c b/init/main.c index ff49a6dacfbb..4990f7ec776a 100644 --- a/init/main.c +++ b/init/main.c @@ -374,11 +374,8 @@ static noinline void __init_refok rest_init(void) * at least once to get things moving: */ init_idle_bootup_task(current); - preempt_enable_no_resched(); - schedule(); - + schedule_preempt_disabled(); /* Call into cpu_idle with preempt disabled */ - preempt_disable(); cpu_idle(); } -- cgit v1.2.1 From 7fa87ce726fa3a2ddd55dc994697dc0e281f9125 Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Wed, 14 Mar 2012 19:12:22 -0600 Subject: init: fix wording error in mm_init comment s/countinuous/contiguous/, reword sentence. Signed-off-by: Jim Cromie Acked-by: KAMEZAWA Hiroyuki Signed-off-by: Jiri Kosina --- init/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'init') diff --git a/init/main.c b/init/main.c index ff49a6dacfbb..09273262e500 100644 --- a/init/main.c +++ b/init/main.c @@ -449,8 +449,8 @@ void __init __weak thread_info_cache_init(void) static void __init mm_init(void) { /* - * page_cgroup requires countinous pages as memmap - * and it's bigger than MAX_ORDER unless SPARSEMEM. + * page_cgroup requires contiguous pages, + * bigger than MAX_ORDER unless SPARSEMEM. */ page_cgroup_init_flatmem(); mem_init(); -- cgit v1.2.1 From bc58450b023c5815e5bc54e6d43edbd1e3576fe6 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 15 Mar 2012 18:19:08 +0000 Subject: init: Remove CONFIG_PPC_ISERIES It is no longer selectable, so remove the check for it. Signed-off-by: Stephen Rothwell Signed-off-by: Benjamin Herrenschmidt --- init/do_mounts_rd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'init') diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index 887629e24c54..01f1306aa26e 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -178,7 +178,7 @@ int __init rd_load_image(char *from) char *buf = NULL; unsigned short rotate = 0; decompress_fn decompressor = NULL; -#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES) +#if !defined(CONFIG_S390) char rotator[4] = { '|' , '/' , '-' , '\\' }; #endif @@ -264,7 +264,7 @@ int __init rd_load_image(char *from) } sys_read(in_fd, buf, BLOCK_SIZE); sys_write(out_fd, buf, BLOCK_SIZE); -#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES) +#if !defined(CONFIG_S390) if (!(i % 16)) { printk("%c\b", rotator[rotate & 0x3]); rotate++; -- cgit v1.2.1 From 8595c539f0360477189eef91f6337ba44962f72d Mon Sep 17 00:00:00 2001 From: Diwakar Tundlam Date: Fri, 23 Mar 2012 15:02:28 -0700 Subject: init: check printed flag to skip printing message Otherwise the 'Calibration skipped' message gets printed everytime a CPU is hotplugged in, cluttering console for systems that frequently hotplug CPUs. Signed-off-by: Diwakar Tundlam Cc: Phil Carmody Cc: Russell King Cc: Greg KH Cc: Sameer Nanda Cc: Peter De Schrijver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- init/calibrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'init') diff --git a/init/calibrate.c b/init/calibrate.c index 5f117ca9e069..fda0a7b0f06c 100644 --- a/init/calibrate.c +++ b/init/calibrate.c @@ -267,7 +267,8 @@ void __cpuinit calibrate_delay(void) if (per_cpu(cpu_loops_per_jiffy, this_cpu)) { lpj = per_cpu(cpu_loops_per_jiffy, this_cpu); - pr_info("Calibrating delay loop (skipped) " + if (!printed) + pr_info("Calibrating delay loop (skipped) " "already calibrated this CPU"); } else if (preset_lpj) { lpj = preset_lpj; -- cgit v1.2.1 From 0e0cb892a8dac7c76321c899934705e5f0812574 Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Fri, 23 Mar 2012 15:02:28 -0700 Subject: init/do_mounts.c: print error code on mount failure Printing the error code makes it easier to debug the cause of a mount failure. For example I had the problem that the root file system could not be mounted read-writeable because my SD card was write-protected. Without an error code it looks like the SD card was not detected at all. Signed-off-by: Bernhard Walle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- init/do_mounts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'init') diff --git a/init/do_mounts.c b/init/do_mounts.c index 2974c8b3b351..0e93f92a0345 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -373,8 +373,8 @@ retry: #ifdef CONFIG_BLOCK __bdevname(ROOT_DEV, b); #endif - printk("VFS: Cannot open root device \"%s\" or %s\n", - root_device_name, b); + printk("VFS: Cannot open root device \"%s\" or %s: error %d\n", + root_device_name, b, err); printk("Please append a correct \"root=\" boot option; here are the available partitions:\n"); printk_all_partitions(); -- cgit v1.2.1 From 026cee0086fe1df4cf74691cf273062cc769617d Mon Sep 17 00:00:00 2001 From: Pawel Moll Date: Mon, 26 Mar 2012 12:50:51 +1030 Subject: params: _initcall-like kernel parameters This patch adds a set of macros that can be used to declare kernel parameters to be parsed _before_ initcalls at a chosen level are executed. We rename the now-unused "flags" field of struct kernel_param as the level. It's signed, for when we use this for early params as well, in future. Linker macro collating init calls had to be modified in order to add additional symbols between levels that are later used by the init code to split the calls into blocks. Signed-off-by: Pawel Moll Signed-off-by: Rusty Russell --- init/main.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 6 deletions(-) (limited to 'init') diff --git a/init/main.c b/init/main.c index c24805c824b9..439715858ba0 100644 --- a/init/main.c +++ b/init/main.c @@ -400,7 +400,7 @@ static int __init do_early_param(char *param, char *val) void __init parse_early_options(char *cmdline) { - parse_args("early options", cmdline, NULL, 0, do_early_param); + parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param); } /* Arch code calls this early on, or if not, just before other parsing. */ @@ -503,7 +503,7 @@ asmlinkage void __init start_kernel(void) parse_early_param(); parse_args("Booting kernel", static_command_line, __start___param, __stop___param - __start___param, - &unknown_bootoption); + 0, 0, &unknown_bootoption); jump_label_init(); @@ -699,16 +699,69 @@ int __init_or_module do_one_initcall(initcall_t fn) } -extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[]; +extern initcall_t __initcall_start[]; +extern initcall_t __initcall0_start[]; +extern initcall_t __initcall1_start[]; +extern initcall_t __initcall2_start[]; +extern initcall_t __initcall3_start[]; +extern initcall_t __initcall4_start[]; +extern initcall_t __initcall5_start[]; +extern initcall_t __initcall6_start[]; +extern initcall_t __initcall7_start[]; +extern initcall_t __initcall_end[]; + +static initcall_t *initcall_levels[] __initdata = { + __initcall0_start, + __initcall1_start, + __initcall2_start, + __initcall3_start, + __initcall4_start, + __initcall5_start, + __initcall6_start, + __initcall7_start, + __initcall_end, +}; + +static char *initcall_level_names[] __initdata = { + "early parameters", + "core parameters", + "postcore parameters", + "arch parameters", + "subsys parameters", + "fs parameters", + "device parameters", + "late parameters", +}; + +static int __init ignore_unknown_bootoption(char *param, char *val) +{ + return 0; +} -static void __init do_initcalls(void) +static void __init do_initcall_level(int level) { + extern const struct kernel_param __start___param[], __stop___param[]; initcall_t *fn; - for (fn = __early_initcall_end; fn < __initcall_end; fn++) + strcpy(static_command_line, saved_command_line); + parse_args(initcall_level_names[level], + static_command_line, __start___param, + __stop___param - __start___param, + level, level, + ignore_unknown_bootoption); + + for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++) do_one_initcall(*fn); } +static void __init do_initcalls(void) +{ + int level; + + for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++) + do_initcall_level(level); +} + /* * Ok, the machine is now initialized. None of the devices * have been touched yet, but the CPU subsystem is up and @@ -732,7 +785,7 @@ static void __init do_pre_smp_initcalls(void) { initcall_t *fn; - for (fn = __initcall_start; fn < __early_initcall_end; fn++) + for (fn = __initcall_start; fn < __initcall0_start; fn++) do_one_initcall(*fn); } -- cgit v1.2.1 From 49a7f04a4b9d45cd794741ce3d5d66524b37bdd0 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 28 Mar 2012 18:30:03 +0100 Subject: Move all declarations of free_initmem() to linux/mm.h Move all declarations of free_initmem() to linux/mm.h so that there's only one and it's used by everything. Signed-off-by: David Howells cc: linux-c6x-dev@linux-c6x.org cc: microblaze-uclinux@itee.uq.edu.au cc: linux-sh@vger.kernel.org cc: sparclinux@vger.kernel.org cc: x86@kernel.org cc: linux-mm@kvack.org --- init/main.c | 1 - 1 file changed, 1 deletion(-) (limited to 'init') diff --git a/init/main.c b/init/main.c index c24805c824b9..44c9754e2a5c 100644 --- a/init/main.c +++ b/init/main.c @@ -87,7 +87,6 @@ extern void mca_init(void); extern void sbus_init(void); extern void prio_tree_init(void); extern void radix_tree_init(void); -extern void free_initmem(void); #ifndef CONFIG_DEBUG_RODATA static inline void mark_rodata_ro(void) { } #endif -- cgit v1.2.1 From 2f99c36986ff27a86f06f27212c5f5fa8c7164a3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 23 Mar 2012 16:04:05 -0400 Subject: get rid of pointless includes of ext2_fs.h Signed-off-by: Al Viro --- init/do_mounts_initrd.c | 1 - 1 file changed, 1 deletion(-) (limited to 'init') diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index 3098a38f3ae1..9047330c73e9 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.1 From 39429c5e4a2c56a39c9a1c9bdad54431c63104b0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 23 Mar 2012 16:36:45 -0400 Subject: new helper: ext2_image_size() ... implemented that way since the next commit will leave it almost alone in ext2_fs.h - most of the file (including struct ext2_super_block) is going to move to fs/ext2/ext2.h. Signed-off-by: Al Viro --- init/do_mounts_rd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'init') diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index 01f1306aa26e..6212586df29a 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -54,20 +54,19 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) { const int size = 512; struct minix_super_block *minixsb; - struct ext2_super_block *ext2sb; struct romfs_super_block *romfsb; struct cramfs_super *cramfsb; struct squashfs_super_block *squashfsb; int nblocks = -1; unsigned char *buf; const char *compress_name; + unsigned long n; buf = kmalloc(size, GFP_KERNEL); if (!buf) return -ENOMEM; minixsb = (struct minix_super_block *) buf; - ext2sb = (struct ext2_super_block *) buf; romfsb = (struct romfs_super_block *) buf; cramfsb = (struct cramfs_super *) buf; squashfsb = (struct squashfs_super_block *) buf; @@ -150,12 +149,12 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) } /* Try ext2 */ - if (ext2sb->s_magic == cpu_to_le16(EXT2_SUPER_MAGIC)) { + n = ext2_image_size(buf); + if (n) { printk(KERN_NOTICE "RAMDISK: ext2 filesystem found at block %d\n", start_block); - nblocks = le32_to_cpu(ext2sb->s_blocks_count) << - le32_to_cpu(ext2sb->s_log_block_size); + nblocks = n; goto done; } -- cgit v1.2.1