Re: [PATCH 6/8] perf sched: Use RC_CHK_EQUAL() to compare pointers
From: Ian Rogers
Date: Wed Jul 02 2025 - 23:10:31 EST
On Wed, Jul 2, 2025 at 6:49 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> So that it can check two pointers to the same object properly when
> REFCNT_CHECKING is on.
>
> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
Thanks,
Ian
> ---
> tools/perf/builtin-sched.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index a6eb0462dd5be20f..087d4eaba5f7160d 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -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;
> }
> }
> --
> 2.50.0.727.gbf7dc18ff4-goog
>