/* *Implementlocal_xchgusingCMPXCHGinstructionwithouttheLOCKprefix. *XCHGisexpensiveduetotheimpliedLOCKprefix.Theprocessor *cannotprefetchcachelinesifXCHGisused.
*/ static __always_inline long
local_xchg(local_t *l, long n)
{ long c = local_read(l);
do { } while (!local_try_cmpxchg(l, &c, n));
return c;
}
/** *local_add_unless-addunlessthenumberisalreadyagivenvalue *@l:pointeroftypelocal_t *@a:theamounttoaddtol... *@u:...unlesslisequaltou. * *Atomicallyadds@ato@l,if@vwasnotalready@u. *Returnstrueiftheadditionwasdone.
*/ static __always_inline bool
local_add_unless(local_t *l, long a, long u)
{ long c = local_read(l);
do { if (unlikely(c == u)) returnfalse;
} while (!local_try_cmpxchg(l, &c, c + a));
/* On x86_32, these are no better than the atomic variants. *Onx86-64thesearebetterthantheatomicvariantsonSMPkernels *becausetheydontusealockprefix.
*/ #define __local_inc(l) local_inc(l) #define __local_dec(l) local_dec(l) #define __local_add(i, l) local_add((i), (l)) #define __local_sub(i, l) local_sub((i), (l))
#endif/* _ASM_X86_LOCAL_H */
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.