[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] xen/rwlock: add check_lock() handling to rwlocks



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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.