Skip to contentSkip to conversation

bugs in __schedule()

DISCUSSION gshan 3 participants 11 messages Jun 26, 2007

lore
Share & tools
lore

gshan

author
#0 lore raw

Anybody has suggestions on this crash?

[c02dc4dc] __schedule+0x654/0x788
[c02dc6f4] schedule+0x4c/0xe4
[c02dbe24] __compat_down+0xc8/0x12c
[c0226b60] mv_sw_read_reg+0x178/0x17c
[c02296fc] mvSwIntrTasklet+0x128/0x744
[c0020afc] tasklet_action+0x7c/0xec
[c00204f4] ___do_softirq+0x80/0x11c
[c00205cc] __do_softirq+0x3c/0x6c
[c00206a4] do_softirq+0x60/0x68
[c00207a8] irq_exit+0x6c/0x94
[c0005e1c] do_IRQ+0x88/0xa4
[c0004b70] ret_from_except+0x0/0x18
[c000680c] __delay+0xc/0x14
[c0226598] mv_sw_read_smi_reg+0x84/0x1ac

Thanks,
Gavin
[c0226adc] mv_sw_read_reg+0xf4/0x17c

#1 lore raw
Quoted 1 line · gshan

Anybody has suggestions on this crash?

talk to whoever supplied the following into your kernel:

Quoted 4 lines

[c02dc4dc] __schedule+0x654/0x788
[c02dc6f4] schedule+0x4c/0xe4
[c02dbe24] __compat_down+0xc8/0x12c
[c0226b60] mv_sw_read_reg+0x178/0x17c

this

Quoted 1 line

[c02296fc] mvSwIntrTasklet+0x128/0x744

and this.

Quoted 9 lines

[c0020afc] tasklet_action+0x7c/0xec
[c00204f4] ___do_softirq+0x80/0x11c
[c00205cc] __do_softirq+0x3c/0x6c
[c00206a4] do_softirq+0x60/0x68
[c00207a8] irq_exit+0x6c/0x94
[c0005e1c] do_IRQ+0x88/0xa4
[c0004b70] ret_from_except+0x0/0x18
[c000680c] __delay+0xc/0x14
[c0226598] mv_sw_read_smi_reg+0x84/0x1ac

#3 lore raw
In reply to gshan

Hi Gavin,

Quoted 16 lines · gshan

Anybody has suggestions on this crash?

[c02dc4dc] __schedule+0x654/0x788
[c02dc6f4] schedule+0x4c/0xe4
[c02dbe24] __compat_down+0xc8/0x12c
[c0226b60] mv_sw_read_reg+0x178/0x17c
[c02296fc] mvSwIntrTasklet+0x128/0x744
[c0020afc] tasklet_action+0x7c/0xec
[c00204f4] ___do_softirq+0x80/0x11c
[c00205cc] __do_softirq+0x3c/0x6c
[c00206a4] do_softirq+0x60/0x68
[c00207a8] irq_exit+0x6c/0x94
[c0005e1c] do_IRQ+0x88/0xa4
[c0004b70] ret_from_except+0x0/0x18
[c000680c] __delay+0xc/0x14
[c0226598] mv_sw_read_smi_reg+0x84/0x1ac

I bet you got more output than that, didn't you? :-)

Now I know this must be a "scheduling while interrupts disabled", but why not post the whole error message?

[ Reminds me of the other thread where someone thought just mentioning the EIP without any backtrace / other messages was enough to resolve a boot-time panic. I agree they're all magicians on this list, but Gods they're not ... ]

BTW I don't see "mvSwIntrTasklet" anywhere on -rc6. Is this a -mm kernel?

Cheers,
Satyam

author
#2 lore raw
In reply to Alexey Dobriyan

The code is written by myself. 2 questions:

1) tasklet couldn't sleep?
2) It is because the tasklet take a semaphore?

Thanks,
Gavin

Quoted 25 lines · Alexey Dobriyan
Quoted 1 line · gshan

Anybody has suggestions on this crash?

talk to whoever supplied the following into your kernel:

Quoted 4 lines

[c02dc4dc] __schedule+0x654/0x788
[c02dc6f4] schedule+0x4c/0xe4
[c02dbe24] __compat_down+0xc8/0x12c
[c0226b60] mv_sw_read_reg+0x178/0x17c

this

Quoted 1 line

[c02296fc] mvSwIntrTasklet+0x128/0x744

and this.

Quoted 9 lines

[c0020afc] tasklet_action+0x7c/0xec
[c00204f4] ___do_softirq+0x80/0x11c
[c00205cc] __do_softirq+0x3c/0x6c
[c00206a4] do_softirq+0x60/0x68
[c00207a8] irq_exit+0x6c/0x94
[c0005e1c] do_IRQ+0x88/0xa4
[c0004b70] ret_from_except+0x0/0x18
[c000680c] __delay+0xc/0x14
[c0226598] mv_sw_read_smi_reg+0x84/0x1ac

author
#4 lore raw
In reply to Satyam Sharma

Here is the all output I have:

# ifconfig mgt0 10.0.51.27
BUG: scheduling while atomic: exe/0x00000101/752
caller is schedule+0x4c/0xe4
Call trace:
[c02dc4dc] __schedule+0x654/0x788
[c02dc6f4] schedule+0x4c/0xe4
[c02dbe24] __compat_down+0xc8/0x12c
[c0226b60] mv_sw_read_reg+0x178/0x17c
[c02296fc] mvSwIntrTasklet+0x128/0x744
[c0020afc] tasklet_action+0x7c/0xec
[c00204f4] ___do_softirq+0x80/0x11c
[c00205cc] __do_softirq+0x3c/0x6c
[c00206a4] do_softirq+0x60/0x68
[c00207a8] irq_exit+0x6c/0x94
[c0005e1c] do_IRQ+0x88/0xa4
[c0004b70] ret_from_except+0x0/0x18
[c000680c] __delay+0xc/0x14
[c0226598] mv_sw_read_smi_reg+0x84/0x1ac
[c0226adc] mv_sw_read_reg+0xf4/0x17c
Quoted 34 lines · Satyam Sharma

Hi Gavin,

Quoted 16 lines · gshan

Anybody has suggestions on this crash?

[c02dc4dc] __schedule+0x654/0x788
[c02dc6f4] schedule+0x4c/0xe4
[c02dbe24] __compat_down+0xc8/0x12c
[c0226b60] mv_sw_read_reg+0x178/0x17c
[c02296fc] mvSwIntrTasklet+0x128/0x744
[c0020afc] tasklet_action+0x7c/0xec
[c00204f4] ___do_softirq+0x80/0x11c
[c00205cc] __do_softirq+0x3c/0x6c
[c00206a4] do_softirq+0x60/0x68
[c00207a8] irq_exit+0x6c/0x94
[c0005e1c] do_IRQ+0x88/0xa4
[c0004b70] ret_from_except+0x0/0x18
[c000680c] __delay+0xc/0x14
[c0226598] mv_sw_read_smi_reg+0x84/0x1ac

I bet you got more output than that, didn't you? :-)

Now I know this must be a "scheduling while interrupts disabled", but why not post the whole error message?

[ Reminds me of the other thread where someone thought just mentioning the EIP without any backtrace / other messages was enough to resolve a boot-time panic. I agree they're all magicians on this list, but Gods they're not ... ]

BTW I don't see "mvSwIntrTasklet" anywhere on -rc6. Is this a -mm kernel?

Cheers,
Satyam

#5 lore raw

Hi Gavin,

Quoted 4 lines · gshan

Here is the all output I have:

# ifconfig mgt0 10.0.51.27
BUG: scheduling while atomic: exe/0x00000101/752

Yup, you can't sleep in taskets, they're atomic.

Quoted 5 lines

caller is schedule+0x4c/0xe4

Call trace:
 [c02dc4dc] __schedule+0x654/0x788
 [c02dc6f4] schedule+0x4c/0xe4
 [c02dbe24] __compat_down+0xc8/0x12c

So, you can't use / acquire semaphores in them. Use spinlocks. If the shared data is also accessed from process context, use spin_lock_bh() from the process context code.

Satyam

author
#6 lore raw
Quoted 16 lines · Satyam Sharma

Hi Gavin,

Quoted 4 lines · gshan

Here is the all output I have:

# ifconfig mgt0 10.0.51.27
BUG: scheduling while atomic: exe/0x00000101/752

Yup, you can't sleep in taskets, they're atomic.

Quoted 5 lines

caller is schedule+0x4c/0xe4

Call trace:
 [c02dc4dc] __schedule+0x654/0x788
 [c02dc6f4] schedule+0x4c/0xe4
 [c02dbe24] __compat_down+0xc8/0x12c
Quoted 5 lines

So, you can't use / acquire semaphores in them. Use spinlocks. If the shared data is also accessed from process context, use spin_lock_bh() from the process context code.

Satyam

Thanks, Satyam. So I can replace the tasklet with kernel thread?

#7 lore raw
Quoted 1 line · gshan

Thanks, Satyam. So I can replace the tasklet with kernel thread?

That depends on what you want to do ...

[ BTW: I should correct a typo in my original reply -- I should've said "scheduling while atomic", and not "scheduling while interrupts disabled" because interrupts are _not_ disabled in bottom halves, and from your stack backtrace it was evident that a tasklet was executing. :-) ]

author
#8 lore raw
Quoted 9 lines · Satyam Sharma
Quoted 1 line · gshan

Thanks, Satyam. So I can replace the tasklet with kernel thread?

That depends on what you want to do ...

[ BTW: I should correct a typo in my original reply -- I should've said "scheduling while atomic", and not "scheduling while interrupts disabled" because interrupts are _not_ disabled in bottom halves, and from your stack backtrace it was evident that a tasklet was executing. :-) ]

I mean kernel thread could sleep, but tasklet can't. If so, it meet my requirements.

#9 lore raw
Quoted 2 lines · gshan

I mean kernel thread could sleep, but tasklet can't. If so, it meet my requirements.

That's not really a justification to convert a tasklet to a kernel thread. I suspect the simplest solution to your problem would be to simply replace that semaphore with a spinlock. Other than that, we can't really help without looking at code.

author
#10 lore raw
Quoted 4 lines · Satyam Sharma
Quoted 2 lines · gshan

I mean kernel thread could sleep, but tasklet can't. If so, it meet my requirements.

Quoted 9 lines

That's not really a justification to convert a tasklet to a kernel thread. I suspect the simplest solution to your problem would be to simply replace that semaphore with a spinlock. Other than that, we can't really help without looking at code.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Thank you very much, Satyam. Anyway, I will do experiments. Thank you again :-)