Skip to content

lib/sort: Clean up sort_nonatomic() and sort_r_nonatomic()

Kuan-Wei Chiu bpf lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Drop the already accepted arm-smmu-v3 patch.
- Convert bpf_trace.c to sort_r() instead.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf: Replace sort_r_nonatomic() with sort_r() in check_dup_ids()kernel/trace/bpf_trace.c+1 -11 reply
2/2Revert "lib/sort.c: add _nonatomic() variants with cond_resched()"include/linux/sort.h lib/sort.c+31 -900 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJiri Olsa
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] lib/sort: Clean up sort_nonatomic() and sort_r_nonatomic()

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.
---
Changes in v2:
- Drop the already accepted arm-smmu-v3 patch.
- Convert bpf_trace.c to sort_r() instead.

Kuan-Wei Chiu (2):
bpf: Replace sort_r_nonatomic() with sort_r() in check_dup_ids() Revert "lib/sort.c: add _nonatomic() variants with cond_resched()"

 include/linux/sort.h     |  11 ----
 kernel/trace/bpf_trace.c |   2 +-
 lib/sort.c               | 110 +++++++++++----------------------------
 3 files changed, 32 insertions(+), 91 deletions(-)
Signature · 1 line
2.55.0.1003.g10538fe699-goog