[PATCH bpf-next v1] rqspinlock: Adjust return value for queue destruction

Subsystems: bpf [general] (safe dynamic programs and tools), the rest

STALE327d LANDED

Landed in mainline as 3249e8a17e62 on 2025-11-12.

2 messages, 2 authors, 2025-11-12 · open the first message on its own page

[PATCH bpf-next v1] rqspinlock: Adjust return value for queue destruction

From: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Date: 2025-11-11 01:38:34

Return -ETIMEDOUT whenever non-head waiters are signalled by head, and fix
oversight in commit 7bd6e5ce5be6 ("rqspinlock: Disable queue destruction for
deadlocks"). We no longer signal on deadlocks.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
 kernel/bpf/rqspinlock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/rqspinlock.c b/kernel/bpf/rqspinlock.c
index b94e258bf2b9..3cc23d79a9fc 100644
--- a/kernel/bpf/rqspinlock.c
+++ b/kernel/bpf/rqspinlock.c
@@ -537,7 +537,7 @@ int __lockfunc resilient_queued_spin_lock_slowpath(rqspinlock_t *lock, u32 val)

 		val = arch_mcs_spin_lock_contended(&node->locked);
 		if (val == RES_TIMEOUT_VAL) {
-			ret = -EDEADLK;
+			ret = -ETIMEDOUT;
 			goto waitq_timeout;
 		}

--
2.51.0

Re: [PATCH bpf-next v1] rqspinlock: Adjust return value for queue destruction

From: Amery Hung <hidden>
Date: 2025-11-12 18:18:58

On Mon, Nov 10, 2025 at 5:49 PM Kumar Kartikeya Dwivedi
[off-list ref] wrote:
quoted hunk
Return -ETIMEDOUT whenever non-head waiters are signalled by head, and fix
oversight in commit 7bd6e5ce5be6 ("rqspinlock: Disable queue destruction for
deadlocks"). We no longer signal on deadlocks.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
 kernel/bpf/rqspinlock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/rqspinlock.c b/kernel/bpf/rqspinlock.c
index b94e258bf2b9..3cc23d79a9fc 100644
--- a/kernel/bpf/rqspinlock.c
+++ b/kernel/bpf/rqspinlock.c
@@ -537,7 +537,7 @@ int __lockfunc resilient_queued_spin_lock_slowpath(rqspinlock_t *lock, u32 val)

                val = arch_mcs_spin_lock_contended(&node->locked);
                if (val == RES_TIMEOUT_VAL) {
-                       ret = -EDEADLK;
+                       ret = -ETIMEDOUT;
Make sense.

Reviewed-by: Amery Hung <redacted>
                        goto waitq_timeout;
                }

--
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help