]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf sched: Use RC_CHK_EQUAL() to compare pointers
authorNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 01:49:40 +0000 (18:49 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 18:43:16 +0000 (11:43 -0700)
So that it can check two pointers to the same object properly when
REFCNT_CHECKING is on.

Fixes: 78c32f4cb12f9430 ("libperf rc_check: Add RC_CHK_EQUAL")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250703014942.1369397-7-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-sched.c

index a6eb0462dd5be20f7a71bec7f676a7404d3dd9e8..087d4eaba5f7160dfa83211f54b969c017c29a1e 100644 (file)
@@ -994,7 +994,7 @@ thread_atoms_search(struct rb_root_cached *root, struct thread *thread,
                else if (cmp < 0)
                        node = node->rb_right;
                else {
-                       BUG_ON(thread != atoms->thread);
+                       BUG_ON(!RC_CHK_EQUAL(thread, atoms->thread));
                        return atoms;
                }
        }