On Fri, Jul 11, 2003 at 01:58:49AM -0700, Ned Ren wrote: > Hi, > > This maybe a silly question. I'm wondering for hook modules that I > write for netfilter, is it necessary to do locking (critical section) > when accessing my own global structures? Yes, it is always necessarry to lock your global structures. All of netfilter is running in softirq context. > This is regarding SINGLE CPU systems, is there anything that would > preempt my module while it's at it such as interrupt etc? hard interrupts can always interrupt a softirq - but a softirq doesn't interrupt another softirq (on single cpu). However, all kernel code _has_ to be SMP safe. > Thank you! -- - Harald Welte http://www.netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie