lkml.org 
[lkml]   [2006]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 05/44] generic {,test_and_}{set,clear,change}_bit()
On Fri, Feb 03, 2006 at 10:55:36AM +0100, Martin Waitz wrote:
> On Wed, Feb 01, 2006 at 06:02:29PM +0900, Akinobu Mita wrote:
> > +static __inline__ void set_bit(int nr, volatile unsigned long *addr)
> > +{
> > + unsigned long mask = BITOP_MASK(nr);
> > + unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
> > + unsigned long flags;
> > +
> > + _atomic_spin_lock_irqsave(p, flags);
> > + *p |= mask;
> > + _atomic_spin_unlock_irqrestore(p, flags);
> > +}
>
> You could even use your new generic non-atomic bitops to implement these

Depends - to do so would increase the amount of code within the
locked region, which raises the probability of contention since the
locked time becomes longer.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-07 00:10    [W:1.433 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site