From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbZEYME1 (ORCPT ); Mon, 25 May 2009 08:04:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751985AbZEYMEU (ORCPT ); Mon, 25 May 2009 08:04:20 -0400 Received: from courier.cs.helsinki.fi ([128.214.9.1]:56144 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751839AbZEYMET (ORCPT ); Mon, 25 May 2009 08:04:19 -0400 Date: Mon, 25 May 2009 15:04:20 +0300 (EEST) From: Pekka J Enberg To: Nick Piggin cc: Ingo Molnar , Yinghai Lu , Rusty Russell , Linus Torvalds , "H. Peter Anvin" , Jeff Garzik , Alexander Viro , Linux Kernel Mailing List , Andrew Morton , Peter Zijlstra , cl@linux-foundation.org, mpm@selenic.com Subject: Re: [GIT PULL] scheduler fixes In-Reply-To: <20090525114127.GE24071@wotan.suse.de> Message-ID: References: <20090518202031.GA26549@elte.hu> <4A199327.5030503@kernel.org> <20090525025353.GA2580@elte.hu> <4A1A2261.1000504@kernel.org> <20090525051521.GC23032@elte.hu> <20090525112504.GB24071@wotan.suse.de> <84144f020905250437x585e66a2oc1124a4f1f43059d@mail.gmail.com> <20090525114127.GE24071@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, May 25, 2009 at 02:37:59PM +0300, Pekka Enberg wrote: > > On Mon, May 25, 2009 at 2:25 PM, Nick Piggin wrote: > > > The bootmem allocations of course are required because some hashes may > > > need to be larger than MAX_ORDER without using vmalloc. > > > > > > kmem_cache_init (and mem_init, partially) sets up the kernel memory > > > allocators... > > > > Which comment are you talking about? The "setup kernel memory > > allocators" one? Yeah, I should probably move it couple of lines down. On Mon, 25 May 2009, Nick Piggin wrote: > Yes, just that one. And oh, we probably want to do this too while at it. Nick? >>From b211497261670ff6f9af6b8b0fab429e848ccc87 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 25 May 2009 15:01:35 +0300 Subject: [PATCH] vmalloc: use kzalloc() instead of alloc_bootmem() We can call vmalloc_init() after kmem_cache_init() and use kzalloc() instead of the bootmem allocator when initializing vmalloc data structures. Signed-off-by: Pekka Enberg --- init/main.c | 2 +- mm/vmalloc.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/init/main.c b/init/main.c index fb0e004..766194c 100644 --- a/init/main.c +++ b/init/main.c @@ -585,13 +585,13 @@ asmlinkage void __init start_kernel(void) __stop___param - __start___param, &unknown_bootoption); pidhash_init(); - vmalloc_init(); vfs_caches_init_early(); /* * Set up kernel memory allocators */ mem_init(); kmem_cache_init(); + vmalloc_init(); /* * Set up the scheduler prior starting any interrupts (such as the * timer interrupt). Full topology setup happens at smp_init() diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 083716e..3235138 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -1032,7 +1031,7 @@ void __init vmalloc_init(void) /* Import existing vmlist entries. */ for (tmp = vmlist; tmp; tmp = tmp->next) { - va = alloc_bootmem(sizeof(struct vmap_area)); + va = kzalloc(sizeof(struct vmap_area), GFP_NOWAIT); va->flags = tmp->flags | VM_VM_AREA; va->va_start = (unsigned long)tmp->addr; va->va_end = va->va_start + tmp->size; -- 1.6.0.4