]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
RCU Unwinder stores where it came from last time
authorMaria Matejka <mq@ucw.cz>
Tue, 4 Mar 2025 12:02:01 +0000 (13:02 +0100)
committerMaria Matejka <mq@ucw.cz>
Tue, 4 Mar 2025 12:02:01 +0000 (13:02 +0100)
This information is vital for stuck situations where the
RCU Unwinder keeps longjumping away.

lib/locking.h

index 60928ecc04954f146e83febdda23e0b4ae690722..8f30e67dad5355dc6c7049045d875895cd07da4f 100644 (file)
@@ -493,6 +493,8 @@ static inline void locking_unwind(struct lock_order *desired)
 
 struct rcu_unwinder {
   struct lock_order locking_stack;
+  const char *file;
+  u32 line;
   u32 retry;
   u8 fast;
   jmp_buf buf;
@@ -522,7 +524,7 @@ static inline void _rcu_unwinder_unlock_(struct rcu_unwinder *o UNUSED)
   _i->locking_stack = locking_stack;                                   \
   rcu_read_lock();                                                     \
 
-#define RCU_RETRY(_i) do { if (_i) longjmp(_i->buf, 1); else bug("No rcu retry allowed here"); } while (0)
+#define RCU_RETRY(_i) do { if (_i) { _i->file = __FILE__; _i->line = __LINE__; longjmp(_i->buf, 1); } else bug("No rcu retry allowed here"); } while (0)
 
 #define RCU_RETRY_FAST(_i) do { (_i)->fast++; RCU_RETRY(_i); } while (0)