2006-05-22 18:35:36

by Dave Jones

[permalink] [raw]
Subject: cpu hotplug sleeping from invalid context

(2.6.17rc4-git9)

echo 0 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu1/online

on my dual-core notebook gets me this:

CPU 1 is now offline
SMP alternatives: switching to UP code
SMP alternatives: switching to SMP code
Booting processor 1/1 eip 3000
CPU 1 irqstacks, hard=c0799000 soft=c0779000
Initializing CPU#1
BUG: sleeping function called from invalid context at mm/page_alloc.c:945
in_atomic():0, irqs_disabled():1
<c04500ce> __alloc_pages+0x32/0x2a8
<c0425577> printk+0x1f/0xaf
<c060674d> schedule+0xa21/0xa8a
<c04503a6> get_zeroed_page+0x31/0x3d
<c040a117> cpu_init+0x10a/0x323
<c04176f5> start_secondary+0xc/0x3ef
<c0417afa> cpu_exit_clear+0x22/0x43



2006-05-23 05:44:22

by Ashok Raj

[permalink] [raw]
Subject: Re: cpu hotplug sleeping from invalid context

On Mon, May 22, 2006 at 11:35:34AM -0700, Dave Jones wrote:
>
> (2.6.17rc4-git9)
>
> echo 0 > /sys/devices/system/cpu/cpu1/online
> echo 1 > /sys/devices/system/cpu/cpu1/online
>
> on my dual-core notebook gets me this:
>

I was just purging my inbox this morning, and saw a similar report from
Jacob Shin in the x86-64 discuss list. When i checked with him, he replied
that this is now resolved. I didnt ask what it was... Jacob could you
send a pointer to the fix?

Cheers,
ashok

2006-05-23 05:58:53

by Ashok Raj

[permalink] [raw]
Subject: Re: cpu hotplug sleeping from invalid context

On Mon, May 22, 2006 at 11:35:34AM -0700, Dave Jones wrote:
>
> (2.6.17rc4-git9)
>
> echo 0 > /sys/devices/system/cpu/cpu1/online
> echo 1 > /sys/devices/system/cpu/cpu1/online
>
> on my dual-core notebook gets me this:
>

Ok, i just tried on my Centrino core duo, and the same online/offline
works just fine for me on git-10. I havent tried git-9 though... could you
give git10 a try?

ashok

2006-05-23 14:11:49

by Jacob Shin

[permalink] [raw]
Subject: RE: cpu hotplug sleeping from invalid context

On Tuesday, May 23, 2006 12:42 AM Ashok Raj wrote:
> On Mon, May 22, 2006 at 11:35:34AM -0700, Dave Jones wrote:
>>
>> (2.6.17rc4-git9)
>>
>> echo 0 > /sys/devices/system/cpu/cpu1/online
>> echo 1 > /sys/devices/system/cpu/cpu1/online
>>
>> on my dual-core notebook gets me this:
>>
>
> I was just purging my inbox this morning, and saw a similar report
> from Jacob Shin in the x86-64 discuss list. When i checked with
> him, he replied that this is now resolved. I didnt ask what it
> was... Jacob could you send a pointer to the fix?

http://lkml.org/lkml/2006/4/28/142

It was a simply null pointer fix.

-Jacob

2006-05-23 19:54:49

by Nathan Lynch

[permalink] [raw]
Subject: Re: cpu hotplug sleeping from invalid context

Dave Jones wrote:
> (2.6.17rc4-git9)
>
> echo 0 > /sys/devices/system/cpu/cpu1/online
> echo 1 > /sys/devices/system/cpu/cpu1/online
>
> on my dual-core notebook gets me this:
>
> CPU 1 is now offline
> SMP alternatives: switching to UP code
> SMP alternatives: switching to SMP code
> Booting processor 1/1 eip 3000
> CPU 1 irqstacks, hard=c0799000 soft=c0779000
> Initializing CPU#1
> BUG: sleeping function called from invalid context at mm/page_alloc.c:945
> in_atomic():0, irqs_disabled():1
> <c04500ce> __alloc_pages+0x32/0x2a8
> <c0425577> printk+0x1f/0xaf
> <c060674d> schedule+0xa21/0xa8a
> <c04503a6> get_zeroed_page+0x31/0x3d
> <c040a117> cpu_init+0x10a/0x323
> <c04176f5> start_secondary+0xc/0x3ef
> <c0417afa> cpu_exit_clear+0x22/0x43

I think it's caused by arch/i386/kernel/cpu/common.c::cpu_init() doing
get_zeroed_page(GFP_KERNEL).