Skip to contentSkip to conversation

selftests/sched_ext: Fix dsq_move_to_local check

PATCH Applied Cheng-Yang Chou 2 participants 2 messages Jun 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/sched_ext: Fix dsq_move_to_local check

scan_dsq_pool() checked == 0 against scx_bpf_dsq_move_to_local(), which returns true on success. This inverted success and failure, causing peek_dsq_dispatch() to double-dispatch on success and skip the real_dsq fallback on failure.

---
 tools/testing/selftests/sched_ext/peek_dsq.bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/sched_ext/peek_dsq.bpf.c +1 -1
index 7f23fb17b1e0..9e802b52b29e 100644
@@ -95,7 +95,7 @@ static int scan_dsq_pool(void)
 			record_peek_result(task->pid);
 
 			/* Try to move this task to local */
-			if (!moved && scx_bpf_dsq_move_to_local(dsq_id, 0) == 0) {
+			if (!moved && scx_bpf_dsq_move_to_local(dsq_id, 0)) {
 				moved = 1;
 				break;
 			}
Signature · 1 line
2.48.1
reviewer Applied
#1 lore raw

Hello,

Quoted 4 lines · Cheng-Yang Chou

scan_dsq_pool() checked == 0 against scx_bpf_dsq_move_to_local(), which returns true on success. This inverted success and failure, causing peek_dsq_dispatch() to double-dispatch on success and skip the real_dsq fallback on failure.

Applied to sched_ext/for-7.2.

Thanks.

--
tejun