Re: in_atomic doesn't count local_irq_disable?

From: Srivatsa Vaddagiri
Date: Mon Dec 29 2003 - 08:31:28 EST


FYI, I am running with preemption disabled ..

On Mon, Dec 29, 2003 at 07:03:36PM +0530, Srivatsa Vaddagiri wrote:
> 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!
>
>
> --
>
>
> Thanks and Regards,
> Srivatsa Vaddagiri,
> Linux Technology Center,
> IBM Software Labs,
> Bangalore, INDIA - 560033

--


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560033
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/