Hi Peter, Vineet,
On Wed, 2018-03-14 at 18:53 +0100, Peter Zijlstra wrote:
On Wed, Mar 14, 2018 at 09:58:19AM -0700, Vineet Gupta wrote:More I look at this initially quite simple thing more it looks like
Well it is broken wrt the semantics the syscall is supposed to provide.*shudder*... just catch the -EFAULT, force the write fault and retry.
Preemption disabling is what prevents a concurrent thread from coming in and
modifying the same location (Imagine a variable which is being cmpxchg
concurrently by 2 threads).
One approach is to do it the MIPS way, emulate the llsc flag - set it under
preemption disabled section and clear it in switch_to
a can of worms...