All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,yonghong.song@linux.dev,song@kernel.org,
	rostedt@goodmis.org,mhiramat@kernel.org,memxor@gmail.com,matt@bobrowski.net,
	mathieu.desnoyers@efficios.com,martin.lau@linux.dev,marscheng@google.com,
	kpsingh@kernel.org,jserv@ccns.ncku.edu.tw,jolsa@kernel.org,
	ihor.solodrai@linux.dev,hch@infradead.org,emil@etsalapatis.com,
	eleanor.lin@realtek.com,eddyz87@gmail.com,daniel@iogearbox.net,
	ast@kernel.org,andrii@kernel.org,visitorckw@gmail.com,
	akpm@linux-foundation.org
Subject: + bpf-replace-sort_r_nonatomic-with-sort_r-in-check_dup_ids.patch added to mm-nonmm-unstable branch
Date: Fri, 30 Oct 2026 19:12:18 -0700	[thread overview]
Message-ID: <20261031021218.D274B1F000C1@smtp.kernel.org> (raw)


The patch titled
     Subject: bpf: replace sort_r_nonatomic() with sort_r() in check_dup_ids()
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     bpf-replace-sort_r_nonatomic-with-sort_r-in-check_dup_ids.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/bpf-replace-sort_r_nonatomic-with-sort_r-in-check_dup_ids.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: bpf: replace sort_r_nonatomic() with sort_r() in check_dup_ids()
Date: Thu, 10 Sep 2026 16:52:20 +0000

Patch series "lib/sort: Clean up sort_nonatomic() and sort_r_nonatomic()",
v2.

kernel/trace/bpf_trace.c is the sole remaining user of sort_r_nonatomic().
Switch check_dup_ids() to sort_r() to match
bpf_kprobe_multi_link_attach() in the same file, which has safely used
sort_r() under the same limit (1U << 20) for 4 years.

With no users left in the tree, remove the unused sort_nonatomic() and
sort_r_nonatomic() APIs.  This drops the __sort_r() wrapper and eliminates
the may_schedule branch and cond_resched() from the inner sorting loop.


This patch (of 2):

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.

Link: https://lore.kernel.org/20260910165222.1186628-1-visitorckw@gmail.com
Link: https://lore.kernel.org/20260910165222.1186628-2-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Song Liu <song@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: <matt@bobrowski.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ihor Solodrai <ihor.solodrai@linux.dev>
Cc: <martin.lau@linux.dev>
Cc: Yonghong Song <yonghong.song@linux.dev>
Cc: Emil Tsalapatis <emil@etsalapatis.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: <hch@infradead.org>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Yu-Chun Lin <eleanor.lin@realtek.com>
Cc: <marscheng@google.com>
---

 kernel/trace/bpf_trace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/trace/bpf_trace.c~bpf-replace-sort_r_nonatomic-with-sort_r-in-check_dup_ids
+++ a/kernel/trace/bpf_trace.c
@@ -3842,7 +3842,7 @@ static int check_dup_ids(u32 *ids, u64 *
 	 * 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]) {
_

Patches currently in -mm which might be from visitorckw@gmail.com are

bpf-replace-sort_r_nonatomic-with-sort_r-in-check_dup_ids.patch
revert-lib-sortc-add-_nonatomic-variants-with-cond_resched.patch


                 reply	other threads:[~2026-10-31  2:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261031021218.D274B1F000C1@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=eleanor.lin@realtek.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=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=mm-commits@vger.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.