From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: 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
Cc: jolsa@kernel.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, Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: [PATCH v2 1/2] bpf: Replace sort_r_nonatomic() with sort_r() in check_dup_ids()
Date: Thu, 10 Sep 2026 16:52:20 +0000 [thread overview]
Message-ID: <20260910165222.1186628-2-visitorckw@gmail.com> (raw)
In-Reply-To: <20260910165222.1186628-1-visitorckw@gmail.com>
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.
Switch check_dup_ids() from sort_r_nonatomic() to sort_r() to match it.
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
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-10 16:52 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 ` Kuan-Wei Chiu [this message]
2026-09-11 8:36 ` [PATCH v2 1/2] bpf: Replace sort_r_nonatomic() with sort_r() in check_dup_ids() Jiri Olsa
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=20260910165222.1186628-2-visitorckw@gmail.com \
--to=visitorckw@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=jolsa@kernel.org \
--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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®