mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] init: introduce mm_init()
@ 2009-06-11 15:47 Pekka J Enberg
  2009-06-11 15:56 ` Linus Torvalds
  2009-06-11 15:57 ` Christoph Lameter
  0 siblings, 2 replies; 6+ messages in thread
From: Pekka J Enberg @ 2009-06-11 15:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: cl, mingo, torvalds

From: Pekka Enberg <penberg@cs.helsinki.fi>

As suggested by Christoph Lameter, introduce mm_init() now that we initialize
all the kernel memory allocations together.

Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 init/main.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/init/main.c b/init/main.c
index 6d38f96..9e4bc82 100644
--- a/init/main.c
+++ b/init/main.c
@@ -533,6 +533,16 @@ void __init __weak thread_info_cache_init(void)
 {
 }
 
+static void __init mm_init(void)
+{
+	/*
+	 * Set up kernel memory allocators
+	 */
+	mem_init();
+	kmem_cache_init();
+	vmalloc_init();
+}
+
 asmlinkage void __init start_kernel(void)
 {
 	char * command_line;
@@ -590,12 +600,7 @@ asmlinkage void __init start_kernel(void)
 	vfs_caches_init_early();
 	sort_main_extable();
 	trap_init();
-	/*
-	 * Set up kernel memory allocators
-	 */
-	mem_init();
-	kmem_cache_init();
-	vmalloc_init();
+	mm_init();
 	/*
 	 * Set up the scheduler prior starting any interrupts (such as the
 	 * timer interrupt). Full topology setup happens at smp_init()
-- 
1.6.0.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] init: introduce mm_init()
  2009-06-11 15:47 [PATCH] init: introduce mm_init() Pekka J Enberg
@ 2009-06-11 15:56 ` Linus Torvalds
  2009-06-11 16:01   ` Pekka Enberg
  2009-06-11 15:57 ` Christoph Lameter
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2009-06-11 15:56 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: linux-kernel, cl, mingo



On Thu, 11 Jun 2009, Pekka J Enberg wrote:
>  
> +static void __init mm_init(void)
> +{
> +	/*
> +	 * Set up kernel memory allocators
> +	 */
> +	mem_init();
> +	kmem_cache_init();
> +	vmalloc_init();
> +}

Please just put the comments at the top of the function in cases like 
this, ie just

	/*
	 * ...
	 */
	static int __init mm_init(void)
	{
		..
	}

also, I'm now terminally confused about the whole series, so I'm wondering 
if you could re-do the series so that (a) I have a clear picture of what 
to take, and (b) preferably so it's also all bisectable (ie the trap_init 
ordering fixes are done in the initial mm/init.c changes).

		Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] init: introduce mm_init()
  2009-06-11 15:47 [PATCH] init: introduce mm_init() Pekka J Enberg
  2009-06-11 15:56 ` Linus Torvalds
@ 2009-06-11 15:57 ` Christoph Lameter
  2009-06-11 16:31   ` Pekka Enberg
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Lameter @ 2009-06-11 15:57 UTC (permalink / raw)
  To: Pekka J Enberg; +Cc: linux-kernel, mingo, torvalds

You forgot to move it to mm/mm_init.c

On Thu, 11 Jun 2009, Pekka J Enberg wrote:

> From: Pekka Enberg <penberg@cs.helsinki.fi>
>
> As suggested by Christoph Lameter, introduce mm_init() now that we initialize
> all the kernel memory allocations together.
>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
> ---
>  init/main.c |   17 +++++++++++------
>  1 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/init/main.c b/init/main.c
> index 6d38f96..9e4bc82 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -533,6 +533,16 @@ void __init __weak thread_info_cache_init(void)
>  {
>  }
>
> +static void __init mm_init(void)
> +{
> +	/*
> +	 * Set up kernel memory allocators
> +	 */
> +	mem_init();
> +	kmem_cache_init();
> +	vmalloc_init();
> +}
> +
>  asmlinkage void __init start_kernel(void)
>  {
>  	char * command_line;
> @@ -590,12 +600,7 @@ asmlinkage void __init start_kernel(void)
>  	vfs_caches_init_early();
>  	sort_main_extable();
>  	trap_init();
> -	/*
> -	 * Set up kernel memory allocators
> -	 */
> -	mem_init();
> -	kmem_cache_init();
> -	vmalloc_init();
> +	mm_init();
>  	/*
>  	 * Set up the scheduler prior starting any interrupts (such as the
>  	 * timer interrupt). Full topology setup happens at smp_init()
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] init: introduce mm_init()
  2009-06-11 15:56 ` Linus Torvalds
@ 2009-06-11 16:01   ` Pekka Enberg
  0 siblings, 0 replies; 6+ messages in thread
From: Pekka Enberg @ 2009-06-11 16:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, cl, mingo

Hi Linus,

On Thu, 2009-06-11 at 08:56 -0700, Linus Torvalds wrote:
> Please just put the comments at the top of the function in cases like 
> this, ie just
> 
> 	/*
> 	 * ...
> 	 */
> 	static int __init mm_init(void)
> 	{
> 		..
> 	}

Fixed.

On Thu, 2009-06-11 at 08:56 -0700, Linus Torvalds wrote:
> also, I'm now terminally confused about the whole series, so I'm wondering 
> if you could re-do the series so that (a) I have a clear picture of what 
> to take, and (b) preferably so it's also all bisectable (ie the trap_init 
> ordering fixes are done in the initial mm/init.c changes).

Yup, I will do that and send a v3 of the pull request. I am compiling a
kernel here to try out my tree on 32-bit. I think Ingo is busy preparing
his remaining merges now so I haven't gotten confirmation from him
whether my patch fixes the problem he saw or not.

			Pekka


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] init: introduce mm_init()
  2009-06-11 15:57 ` Christoph Lameter
@ 2009-06-11 16:31   ` Pekka Enberg
  2009-06-11 16:35     ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Pekka Enberg @ 2009-06-11 16:31 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: linux-kernel, mingo, torvalds

On Thu, 2009-06-11 at 11:57 -0400, Christoph Lameter wrote:
> You forgot to move it to mm/mm_init.c

OK, but that needs to wait for another day. The patch series is already
getting pretty big and there's no mminit.h in include/linux for this.

			Pekka


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] init: introduce mm_init()
  2009-06-11 16:31   ` Pekka Enberg
@ 2009-06-11 16:35     ` Linus Torvalds
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2009-06-11 16:35 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Christoph Lameter, linux-kernel, mingo



On Thu, 11 Jun 2009, Pekka Enberg wrote:

> On Thu, 2009-06-11 at 11:57 -0400, Christoph Lameter wrote:
> > You forgot to move it to mm/mm_init.c
> 
> OK, but that needs to wait for another day. The patch series is already
> getting pretty big and there's no mminit.h in include/linux for this.

Yeah. Keep it in init/main.c for now. Let's keep it all simple.

		Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-11 16:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-11 15:47 [PATCH] init: introduce mm_init() Pekka J Enberg
2009-06-11 15:56 ` Linus Torvalds
2009-06-11 16:01   ` Pekka Enberg
2009-06-11 15:57 ` Christoph Lameter
2009-06-11 16:31   ` Pekka Enberg
2009-06-11 16:35     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®