Christoph Lameter wrote: > Could you come up with a patch? Currently, I do not seem to be able to > spend enough time on it. Please have a look at this sample. Temporary solution while we are waiting for: test_and_set_bit (int nr, volatile void *addr, MODE_BARRIER) & co. I changed the temp. variables to be 64 bit wide in order to eliminate a "zxt4". Here is what I get (NOP-s removed): : [MMI] mf;; : and r10=31,r18 : extr r11=r18,5,27;; : [MFI] shladd r16=r11,2,r16 : shl r17=r19,r10;; : [MMI] ld4.bias.nta r20=[r16];; : or r22=r17,r20 : mov.m ar.ccv=r20;; : [MMI] cmpxchg4.acq.nta r21=[r16],r22,ar.ccv;; : cmp.eq p14,p15=r20,r21 : [BBB] (p15) br.cond.dptk.few Notes: "reserve_bootmem_core()" is a typical example of unnecessary fencing. What a nasty business reversing the "old" vs. "new" parameters: #define ia64_cmpxchg(sem,ptr,old,new,size) ... _r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_);