[Devel] Re: [PATCH 1/13] BC: atomic_dec_and_lock_irqsave() helper

Cedric Le Goater cedric at legoater.org
Fri Nov 10 07:19:37 PST 2006


Hello Kirill, Hello Pavel,

Kirill Korotaev wrote:
> Oleg Nesterov noticed to me that the construction like
> (used in beancounter patches and free_uid()):
> 
>   local_irq_save(flags);
>   if (atomic_dec_and_lock(&refcnt, &lock))
> 	  ...
> 
> is not that good for preemtible kernels, since with preemption
> spin_lock() can schedule() to reduce latency. However, it won't schedule
> if interrupts are disabled.
> 
> So this patch introduces atomic_dec_and_lock_irqsave() as a logical
> counterpart to atomic_dec_and_lock().

You should probably send that one independently from the BC 
patchset. 

C.




More information about the Devel mailing list