Re: [PATCH v2] locking/qrwlock: Fix ordering in queued_write_lock_slowpath

2021-04-16 Thread Peter Zijlstra
I've edited the thing to look like so. I'll go queue it for locking/urgent. --- Subject: locking/qrwlock: Fix ordering in queued_write_lock_slowpath() From: Ali Saidi Date: Thu, 15 Apr 2021 17:27:11 + From: Ali Saidi While this code is executed with the wait_lock held, a reader can acqu

Re: [PATCH v2] locking/qrwlock: Fix ordering in queued_write_lock_slowpath

2021-04-15 Thread Waiman Long
On 4/15/21 1:27 PM, Ali Saidi wrote: While this code is executed with the wait_lock held, a reader can acquire the lock without holding wait_lock. The writer side loops checking the value with the atomic_cond_read_acquire(), but only truly acquires the lock when the compare-and-exchange is compl

[PATCH v2] locking/qrwlock: Fix ordering in queued_write_lock_slowpath

2021-04-15 Thread Ali Saidi
While this code is executed with the wait_lock held, a reader can acquire the lock without holding wait_lock. The writer side loops checking the value with the atomic_cond_read_acquire(), but only truly acquires the lock when the compare-and-exchange is completed successfully which isn’t ordered.