in_softirq() question

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

 



I'm writing a module that needs to synchronize with its own tasklet (bottom 
half).  Basically, I need to disable the bottom half whenever the driver has 
been called to do some work.  The tasklet is just a periodic timer that keeps 
the hardware awake, but it should never pre-empty the driver itself.

To do this, I have added local_bh_disable() calls at the top of every entry 
point in my driver.  This works very well.  However, I would add to like 
additional checks to make sure that various code is not executed whenever 
bottom halves are disabled.

I discovered function in_softirq(), but I'm having a hard time understanding 
it.  There's no documentation for it (not even any comments!), and the modules 
in the kernel that do use it don't explain it either.

The code for in_softirq() makes me think that it returns non-zero if any 
thread on this CPU has called local_bh_disable(), which is what I want.  But 
what does in_softirq() means?  If I call local_bh_disable(), soft IRQs are 
disabled, are they not?  Isn't that what a bottom-half is, a soft IRQ?

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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