ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions
kangshan0910 at gmail.com
Fri Jul 13 05:10:52 EDT 2012
For example, in the following scenario, Process2 may get the wrong value;
write data; (store operation)
read data; (load operation)
Suppose Process1 gets the lock first, write data and unlock. If the
store operation completes very slowly, the load operation of the
Process2 will fail to get the new value.
Since there are no dmb instructions in the mutex_lock and
mutex_unlock, which doesn't make sure that after Process2 gets the
lock, the result of the Process1's store operation will be seen by the
2012/7/13 Li Haifeng <omycle at gmail.com>:
> Hi Shan,
> 2012/7/12 shan kang <kangshan0910 at gmail.com>:
>> I wonder why smp_mb() is not needed in the "__mutex_fastpath_lock"
>> and "__mutex_fastpath_unlock" functions which are located in the
>> I think "dmb" instruction is necessary there.
> Why necessary? Could you explain more detailed?
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
More information about the linux-arm-kernel