lib/list_sort: Clean up list_sort() scheduling workarounds
Status from this message: [merged mm-nonmm-stable] lib-list_sort-remove-dummy-cmp-calls-to-speed-up-merge_final.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 4 repliesApplied 2/2
- v21 patch 3 repliesSuperseded
Changes in v3 from the cover letter
- Abandoned the idea of introducing a new list_sort_nonatomic() API.
- Removed the dummy cmp() hack.
- Dropped the cond_resched() calls from UBIFS.
- Split the changes into a 2-patch series.
- Dropped Zhihao Cheng's Reviewed-by tag due to the fundamental change.
Patches in v3 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | ubifs: Remove unnecessary cond_resched() from list_sort() comparefs/ fs/ | +0 | 2 replies | Applied |
| 2/2 | lib/list_sort: Remove dummy cmp() calls to speed up merge_final()lib/ | +0 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Zhihao Cheng | Christoph Hellwig | Richard Weinberger |
|---|---|---|---|
| 1/2 | R-b | A-b | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v3 0/2] lib/list_sort: Clean up list_sort() scheduling workarounds
Historically, list_sort() included a hack in merge_final() that periodically invoked dummy cmp(priv, b, b) calls when merging highly unbalanced lists. This allowed the caller to invoke cond_resched() within their comparison callbacks to avoid soft lockups.
However, an audit of the kernel tree shows that fs/ubifs/ has been the sole user of this mechanism. For all other generic list_sort() users, this results in wasted function calls and unnecessary overhead in a tight loop.
Recent discussions and code inspection confirmed that the lists being sorted in UBIFS are bounded in size (a few thousand elements at most), and the comparison functions are extremely lightweight. Therefore, UBIFS does not actually need to rely on this mechanism.
---
Changes in v3:
- Abandoned the idea of introducing a new list_sort_nonatomic() API.
- Removed the dummy cmp() hack.
- Dropped the cond_resched() calls from UBIFS.
- Split the changes into a 2-patch series.
- Dropped Zhihao Cheng's Reviewed-by tag due to the fundamental change.
Changes in v2:
- Dropped the u8 count rate-limiter in merge() and merge_final().
- Removed cond_resched() calls from UBIFS comparison callbacks.
v2: https://lore.kernel.org/lkml/[email protected]/
v1: https://lore.kernel.org/lkml/[email protected]/
Kuan-Wei Chiu (2):
ubifs: Remove unnecessary cond_resched() from list_sort() compare lib/list_sort: Remove dummy cmp() calls to speed up merge_final()
fs/ubifs/gc.c | 2 -- fs/ubifs/replay.c | 1 - lib/list_sort.c | 9 --------- 3 files changed, 12 deletions(-)
Signature · 1 line
2.53.0.959.g497ff81fa9-goog