On Tue, 12 Dec 2006, Zoltan Menyhart wrote: > Let's assume the bit test & set is already set, why is then the > cmpxchg_acq() executed? Cannot we just return, e.g. like this? > > do { > old = *m; > if (old & bit) > return 1; > new = old | bit; > } while (cmpxchg_acq(m, old, new) != old); I think this will work. However, usually you execute bit test and test because the bit is not set and you want to set it. This change would optimize a rarely taken path. Probably not worth it. - To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |