in_atomic doesn't count local_irq_disable?
Hi,
I am getting messages like:
"Debug: sleeping function called from invalid context at include/linux/rwsem.h:45" "in_atomic: 0, irqs_disabled(): 1"
while running some (CPU Hotplug) tests against (2.6.0-test11-bk6 + the CPU hotplug patch).
This is basically because down_read was called with interrupts disabled .. __might_sleep was "unable" to dump the stack of callers which lead to this problem ..
I put some debug code in down_read (an inline function) and found that down_read was actually called from do_page_fault.
do_page_fault avoids calling this down_read if we are "in_atomic()" Isn't in_atomic supposed to count IRQs disabled case? If not then shouldn't do_page_fault also check for irqs_disabled() before calling down_read()?
Please let me know what I am missing here!
Signature · 5 lines
Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560033
FYI, I am running with preemption disabled ..
Quoted 31 lines · Srivatsa Vaddagiri
Hi,
I am getting messages like:"Debug: sleeping function called from invalid context at
include/linux/rwsem.h:45" "in_atomic: 0,irqs_disabled(): 1"while running some (CPU Hotplug) tests against (2.6.0-test11-bk6 + the CPU hotplug patch).
This is basically because
down_readwas called with interrupts disabled ..__might_sleepwas "unable" to dump the stack of callers which lead to this problem ..I put some debug code in
down_read(an inline function) and found thatdown_readwas actually called fromdo_page_fault.
do_page_faultavoids calling thisdown_readif we are "in_atomic()" Isn'tin_atomicsupposed to count IRQs disabled case? If not then shouldn'tdo_page_faultalso check forirqs_disabled()before callingdown_read()?Please let me know what I am missing here!
Signature · 5 lines
Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560033
Signature · 5 lines
Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560033
Quoted 4 lines · On Mon, 29 Dec 2003 19:03:36 +0530 Srivatsa Vaddagiri <[email protected]> wrote:
do_page_faultavoids calling thisdown_readif we are "in_atomic()" Isn'tin_atomicsupposed to count IRQs disabled case? If not then shouldn'tdo_page_faultalso check forirqs_disabled()before callingdown_read()?
in_atomic() doesn't actually return true if irqs are disabled.
hence "(in_atomic() || irqs_disabled())" in __might_sleep.
do_page_fault should have the same test...
Thanks,
Rusty.
Signature · 2 lines
there are those who do and those who hang on and you don't see too many doers quoting their contemporaries. -- Larry McVoy