Re: sort of ... spinlock_softirq()

Juanjo Ciarlante (irriga@impsat1.com.ar)
Fri, 14 Aug 1998 21:39:50 -0300


On Sat, Aug 15, 1998 at 01:24:25AM +0200, Andi Kleen wrote:
> In article <19980814204643.B17095@impsat1.com.ar>,
> Juanjo Ciarlante <irriga@impsat1.com.ar> writes:
>
> write_lock_irqsave() is faster than start_bh_atomic(), because
> start_bh_atomic calls synchronize_bh currently which can be costly. Also
> start_bh_atomic is a global locking algorithm, while write_lock_irqsave
> works local which is faster - when irqs are disabled on the current CPU
> then other CPUs can still process them. In a start_bh_atomic you block
> out all BHs on all CPUs.
and what about UP ?

> > If critical_section() is ``short enough'' (eg. change a bound variable),
> > is HARD irq stuff faster than SOFT xx_bh_atomic()?
>
> If it is only a variable setting or increase/decrease/test then you can
> use the atomic_set/atomic_inc/atomic_dec/atomic_dec_and_test functions too.
> xchg() may also do what you want.
True, but I need to ``bound-and-reset'' an increasing value.

Regards!

-- 
-- Juanjo       http://juanjox.home.ml.org/

- 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