From: Jiri Olsa <olsajiri@gmail.com>
To: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: song@kernel.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, eddyz87@gmail.com, memxor@gmail.com,
kpsingh@kernel.org, matt@bobrowski.net, rostedt@goodmis.org,
mhiramat@kernel.org, akpm@linux-foundation.org,
ihor.solodrai@linux.dev, martin.lau@linux.dev,
yonghong.song@linux.dev, emil@etsalapatis.com,
mathieu.desnoyers@efficios.com, hch@infradead.org,
jserv@ccns.ncku.edu.tw, eleanor15x@gmail.com,
marscheng@google.com, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH v2 1/2] bpf: Replace sort_r_nonatomic() with sort_r() in check_dup_ids()
Date: Fri, 11 Sep 2026 10:36:27 +0200 [thread overview]
Message-ID: <aqO9iw319w0Z11U6@krava> (raw)
In-Reply-To: <20260910165222.1186628-2-visitorckw@gmail.com>
On Thu, Sep 10, 2026 at 04:52:20PM +0000, Kuan-Wei Chiu wrote:
> bpf_kprobe_multi_link_attach() in the same file has been using sort_r()
> under the exact same limit (1U << 20) for 4 years without issues.
true
> Switch check_dup_ids() from sort_r_nonatomic() to sort_r() to match it.
I looked it up and I used that based on sashiko comment,
it seems like switching to sort_r sould be fine
Acked-by: Jiri Olsa <jolsa@kernel.org>
>
> This removes the last in-tree user of sort_r_nonatomic(), allowing the
> unused _nonatomic() sort variants to be dropped from the core library.
>
> Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
> ---
> Build test only
I ran bpf ci on this, it passed
jirka
>
> kernel/trace/bpf_trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
> index 29260951aa87..1d7e73ddbafb 100644
> --- a/kernel/trace/bpf_trace.c
> +++ b/kernel/trace/bpf_trace.c
> @@ -3826,7 +3826,7 @@ static int check_dup_ids(u32 *ids, u64 *cookies, u32 cnt)
> * and check it for duplicates. The ids and cookies arrays
> * are left sorted.
> */
> - sort_r_nonatomic(ids, cnt, sizeof(ids[0]), ids_cmp_r, ids_swap_r, data);
> + sort_r(ids, cnt, sizeof(ids[0]), ids_cmp_r, ids_swap_r, data);
>
> for (int i = 1; i < cnt; i++) {
> if (ids[i] == ids[i - 1]) {
> --
> 2.55.0.1003.g10538fe699-goog
>
next prev parent reply other threads:[~2026-09-11 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 16:52 [PATCH v2 0/2] lib/sort: Clean up sort_nonatomic() and sort_r_nonatomic() Kuan-Wei Chiu
2026-09-10 16:52 ` [PATCH v2 1/2] bpf: Replace sort_r_nonatomic() with sort_r() in check_dup_ids() Kuan-Wei Chiu
2026-09-11 8:36 ` Jiri Olsa [this message]
2026-09-10 16:52 ` [PATCH v2 2/2] Revert "lib/sort.c: add _nonatomic() variants with cond_resched()" Kuan-Wei Chiu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aqO9iw319w0Z11U6@krava \
--to=olsajiri@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=eleanor15x@gmail.com \
--cc=emil@etsalapatis.com \
--cc=hch@infradead.org \
--cc=ihor.solodrai@linux.dev \
--cc=jserv@ccns.ncku.edu.tw \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marscheng@google.com \
--cc=martin.lau@linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=matt@bobrowski.net \
--cc=memxor@gmail.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=song@kernel.org \
--cc=visitorckw@gmail.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.