On 29.02.24 14:49, Jan Beulich wrote:
On 12.12.2023 10:47, Juergen Gross wrote:
In order to prepare a type-safe recursive spinlock structure, add
explicitly non-recursive locking functions to be used for non-recursive
locking of spinlocks, which are used recursively, too.

Signed-off-by: Juergen Gross <jgr...@suse.com>

Acked-by: Jan Beulich <jbeul...@suse.com>
preferably with ...

--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -101,6 +101,8 @@ struct lock_profile_qhead {
  };
#define _LOCK_PROFILE(lockname) { .name = #lockname, .lock = &lockname, }
+#define _RLOCK_PROFILE(lockname) { .name = #lockname, .rlock = &lockname,     \
+    .is_rlock = 1, }

... "true" used here, ...

@@ -133,13 +135,16 @@ struct lock_profile_qhead {
              break;                                                            
\
          }                                                                     
\
          prof->name = #l;                                                      
\
-        prof->lock = &(s)->l;                                                 \
+        prof->lockptr = &(s)->l;                                              \
+        prof->is_rlock = isr;                                                 \
          prof->next = (s)->profile_head.elem_q;                                
\
          (s)->profile_head.elem_q = prof;                                      
\
      } while( 0 )
-#define spin_lock_init_prof(s, l) __spin_lock_init_prof(s, l, spinlock_t)
-#define rspin_lock_init_prof(s, l) __spin_lock_init_prof(s, l, rspinlock_t)
+#define spin_lock_init_prof(s, l)                                             \
+    __spin_lock_init_prof(s, l, lock, spinlock_t, 0)

... "false" here, ...

+#define rspin_lock_init_prof(s, l)                                            \
+    __spin_lock_init_prof(s, l, rlock, rspinlock_t, 1)

... "true" again here, and ...

@@ -174,6 +179,7 @@ struct lock_profile_qhead { };
#endif +
  typedef union {
      uint32_t head_tail;
      struct {

... definitely with this hunk dropped.

I'm fine with all of above.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to