mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Travis <travis@sgi.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Christophe Saout <christophe@saout.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH]: xen: fix too early kmalloc call
Date: Mon, 12 Jan 2009 10:22:49 -0800	[thread overview]
Message-ID: <496B8A79.4060309@sgi.com> (raw)
In-Reply-To: <20090112144218.GA18859@cmpxchg.org>

Johannes Weiner wrote:
> On Mon, Jan 12, 2009 at 09:53:02AM +0100, Ingo Molnar wrote:
>> * Mike Travis <travis@sgi.com> wrote:
>>
>>> Subject: xen: fix too early kmalloc call
>>>
>>> From: Christophe Saout <christophe@saout.de> 
>>>
>>> Impact: fixes bootup of xen.
>>>
>>> Christophe reported the following problem:
>>>
>>>>  (basically it seems that SLAB is not yet up, with earlyprintk it is
>>>>  giving me an Oops in __kmalloc before)
>>> Replace call to kmalloc with alloc_bootmem.
>>>
>>> Also from Christophe:
>>>> (me)
>>>>> Or I could copy the text and submit it as a new patch?
>>>> Yes, I would prefer that.  Also, my commit message was not really
>>>> following Kernel standards and it's only a very simple change.
>>> Signed-off-by: Mike Travis <travis@sgi.com>
>> i've applied the fix to tip/cpus4096, in the form below.
>>
>> Please submit clean log messages. Your commit description was confused - 
>> the patch is From: Christophe, but the message talks about Christophe in 
>> the third person. Also, it included conversational bits that have no 
>> value for the Git history.
>>
>> 	Ingo
>>
>> -------------------->
>>> >From 28e08861b9afab4168b758fb7b95aa7a4da0f668 Mon Sep 17 00:00:00 2001
>> From: Christophe Saout <christophe@saout.de>
>> Date: Sun, 11 Jan 2009 11:46:23 -0800
>> Subject: [PATCH] xen: fix too early kmalloc call
>>
>> Impact: fix bootup crash on xen guests
>>
>> SLAB is not yet up, with earlyprintk it is giving me an Oops in __kmalloc.
>>
>> Replace call to kmalloc() with alloc_bootmem().
>>
>> Reported-by: Christophe Saout <christophe@saout.de>
>> Signed-off-by: Mike Travis <travis@sgi.com>
>> Signed-off-by: Ingo Molnar <mingo@elte.hu>
>> ---
>>  drivers/xen/events.c |    5 +++--
>>  1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
>> index ed7527b..3141e14 100644
>> --- a/drivers/xen/events.c
>> +++ b/drivers/xen/events.c
>> @@ -26,6 +26,7 @@
>>  #include <linux/irq.h>
>>  #include <linux/module.h>
>>  #include <linux/string.h>
>> +#include <linux/bootmem.h>
>>  
>>  #include <asm/ptrace.h>
>>  #include <asm/irq.h>
>> @@ -831,8 +832,8 @@ void __init xen_init_IRQ(void)
>>  	int i;
>>  	size_t size = nr_cpu_ids * sizeof(struct cpu_evtchn_s);
>>  
>> -	cpu_evtchn_mask_p = kmalloc(size, GFP_KERNEL);
>> -	BUG_ON(cpu_evtchn_mask == NULL);
>> +	cpu_evtchn_mask_p = alloc_bootmem(size);
>> +	BUG_ON(cpu_evtchn_mask_p == NULL);
> 
> Impossible condition :-) alloc_bootmem() crashes before you could
> catch it here.
> 
> 	Hannes

Yes, that's picked up in a subsequent patch (I didn't catch it the
first time I reviewed it as well.)  There appears to be a queue of
patches for Xen coming, so this last "memory reduction patch" will
follow (or be included with) those.

Thanks,
Mike


  parent reply	other threads:[~2009-01-12 18:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 19:46 Mike Travis
2009-01-12  8:53 ` Ingo Molnar
2009-01-12 14:42   ` Johannes Weiner
2009-01-12 14:46     ` Ingo Molnar
2009-01-12 18:22     ` Mike Travis [this message]
2009-01-12 19:23       ` Christophe Saout
2009-01-12 18:20   ` Mike Travis
2009-01-12 19:13     ` Ingo Molnar

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=496B8A79.4060309@sgi.com \
    --to=travis@sgi.com \
    --cc=christophe@saout.de \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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

Powered by JetHome