lkml.org 
[lkml]   [2011]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] printk: Allocate kernel log buffer earlier

* Mike Travis <travis@sgi.com> wrote:

> On larger systems, because of the numerous ACPI, Bootmem and EFI
> messages, the static log buffer overflows before the larger one
> specified by the log_buf_len param is allocated. Minimize the
> potential for overflow by allocating the new log buffer as soon
> as possible.
>
> We do this by changing the log_buf_len from an early_param to a
> _setup param. But _setup params are processed before the
> alloc_bootmem is available, so this function will now just save
> the requested log buf len. The real work routine (setup_log_buf)
> is called after bootmem is available.
>
> Signed-off-by: Mike Travis <travis@sgi.com>
> Reviewed-by: Jack Steiner <steiner@sgi.com>
> Reviewed-by: Robin Holt <holt@sgi.com>
> ---
> arch/x86/kernel/setup.c | 5 +++
> include/linux/printk.h | 4 ++
> init/main.c | 1
> kernel/printk.c | 75 ++++++++++++++++++++++++++++--------------------
> 4 files changed, 54 insertions(+), 31 deletions(-)

Well, the modern allocation method is memblock - available on all major
architectures.

You could avoid all this ugly workaround of bootmem limitations by moving the
allocation to memblock_alloc() and desupporting the log_buf_len= boot parameter
on non-memblock architectures.

kernel log buffer size can be configured via the .config so they will not be left
without larger buffers.

Doing this should also have the advantage of getting all the early x86 messages into
the larger buffer already, reducing the pressure to apply some of the other patches
in your series.

Thanks,

Ingo


\
 
 \ /
  Last update: 2011-02-27 13:13    [W:1.063 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site