Re: [PATCH 2/6] percpu-refcount: one bit is enough for REF_STATUS

2014-06-17 Thread Lai Jiangshan
On 06/18/2014 09:08 AM, Tejun Heo wrote: > percpu-refcount currently reserves two lowest bits of its percpu > pointer to indicate its state; however, only one bit is used for > PCPU_REF_DEAD. > > Simplify it by removing PCPU_STATUS_BITS/MASK and testing > PCPU_REF_DEAD directly. This also allows

[PATCH 2/6] percpu-refcount: one bit is enough for REF_STATUS

2014-06-17 Thread Tejun Heo
percpu-refcount currently reserves two lowest bits of its percpu pointer to indicate its state; however, only one bit is used for PCPU_REF_DEAD. Simplify it by removing PCPU_STATUS_BITS/MASK and testing PCPU_REF_DEAD directly. This also allows the compiler to choose a more efficient instruction d