From: Andrew Morton <akpm@osdl.org>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [trival patch]disable warning in cpu_init for cpu hotplug
Date: Wed, 22 Mar 2006 21:32:40 -0800 [thread overview]
Message-ID: <20060322213240.6ab28346.akpm@osdl.org> (raw)
In-Reply-To: <1143091268.11430.49.camel@sli10-desk.sh.intel.com>
Shaohua Li <shaohua.li@intel.com> wrote:
>
> The patch seems missed.
> GFP_KERNEL isn't ok for runtime (cpu hotplug).
>
> Signed-off-by: Shaohua Li<shaohua.li@intel.com>
> ---
>
> linux-2.6.15-root/arch/i386/kernel/cpu/common.c | 2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
> diff -puN arch/i386/kernel/cpu/common.c~cpuhp arch/i386/kernel/cpu/common.c
> --- linux-2.6.15/arch/i386/kernel/cpu/common.c~cpuhp 2006-03-14 12:13:43.000000000 +0800
> +++ linux-2.6.15-root/arch/i386/kernel/cpu/common.c 2006-03-14 12:14:12.000000000 +0800
> @@ -605,7 +605,7 @@ void __devinit cpu_init(void)
> /* alloc_bootmem_pages panics on failure, so no check */
> memset(gdt, 0, PAGE_SIZE);
> } else {
> - gdt = (struct desc_struct *)get_zeroed_page(GFP_KERNEL);
> + gdt = (struct desc_struct *)get_zeroed_page(GFP_ATOMIC);
> if (unlikely(!gdt)) {
> printk(KERN_CRIT "CPU%d failed to allocate GDT\n", cpu);
> for (;;)
This isn't good. GFP_ATOMIC can fail, and if it does, we'll lose this CPU
and probably the entire machine. It's OK to do this during initial boot,
but not so OK to do it during CPU hotplug.
So can we please fix it better?
You don't describe _why_ the CPU is running atomically here - I wish you had.
One approach would be to allocate the page earlier, before we enter the
atomic region, and to pass that page down to cpu_init(), or to save a
pointer to it in an array of page*'s somewhere.
next prev parent reply other threads:[~2006-03-23 5:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 5:21 Shaohua Li
2006-03-23 5:32 ` Andrew Morton [this message]
2006-03-23 6:19 ` Shaohua Li
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=20060322213240.6ab28346.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shaohua.li@intel.com \
/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
all inboxes | Powered by JetHome®