On 30.10.20 16:13, Jürgen Groß wrote:
On 30.10.20 16:10, Jan Beulich wrote:
On 30.10.2020 15:25, Juergen Gross wrote:
--- a/xen/include/xen/rwlock.h
+++ b/xen/include/xen/rwlock.h
@@ -65,7 +65,11 @@ static inline int _read_trylock(rwlock_t *lock)
           * arch_lock_acquire_barrier().
           */
          if ( likely(_can_read_lock(cnts)) )
+        {
+            check_lock(&lock->lock.debug, true);
              return 1;
+        }

Why not unconditionally earlier in the function?

Its trylock, so we don't want to call check_lock() without having
got the lock.

Hmm, OTOH we do so for spinlocks, too.

So maybe its really better to move it up.


Juergen

Reply via email to