There's also a section about in_atomic() in the Linux Device Drivers
(3rd ed.) book which may have contributed to the confusion. On p. 198:
A function related to in_interrupt() is in_atomic(). Its
return value is nonzero whenever scheduling is not allowed;
this includes hardware and software interrupt contexts as well
as any time when a spinlock is held. In the latter case,
current may be valid, but access to user space is forbidden,
since it can cause scheduling to happen. Whenever you are
using in_interrupt(), you should really consider whether
in_atomic() is what you actually mean. Both functions are
declared in <asm/hardirq.h>.
Alan Stern
--