Re: why return from raise_softirq() simply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 14, 2010 at 08:57:09PM +0800, Parmenides wrote:
> Hi,
> 
> To acitvate a softirq, the raise_softirq() will be invorked. In this
> function, in_interruput() function is called, and if we get value 1,
> raise_softirq() will return simply. According to ULK3, this situation
> indicates either that raise_softirq() has been invoked in interrupt
> context, or that the softirqs are currently disabled. For the latter,
> namely that the softirqs are currently disabled, I have no idea about
> it. How can we know?


softirqs can be disabled using local_bh_disable(). This will
"simulate" the fact you enter in a softirq context, which means
you can't be interrupted by another level of softirq.

This is simply a check of (preempt_count() & SOFTIRQ_MASK). When
local_bh_disable() is called or when you enter softirqs,
the softirq offset in preempt_count() is incremented.
It is later decremented when you call local_bh_enable() or softirqs
jobs finish.

in_interrupt() returns 1 if you are on a hardirq or softirq.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux