sort of ... spinlock_softirq()

Juanjo Ciarlante (irriga@impsat1.com.ar)
Fri, 14 Aug 1998 20:46:43 -0300


I need some locking stuff in ip_masq to allow user-space masq tunnel
creation (eg. for FTP,IRC,etc transparent proxies) and thought about
the following locking sequence
start_bh_atomic(); /* instead of write_lock_irqsave() */
write_lock(&l);
critical_section(); /* To be accessed ONLY from U and BH context */
write_unlock(&l);
end_bh_atomic();

to avoid using HARD irq disabling.

Is above construct correct?

If critical_section() is ``short enough'' (eg. change a bound variable),
is HARD irq stuff faster than SOFT xx_bh_atomic()?

Regards

-- 
-- Juanjo       http://juanjox.home.ml.org/
                       You don't need an hologram to know...
                       Nor you need to sell your brain to anyone.
                       You can feel it. It's Linux.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html