linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Fix bcache regression with equality-aware heap APIs
@ 2025-06-10 21:55 Kuan-Wei Chiu
  2025-06-10 21:55 ` [PATCH 1/8] lib min_heap: Add equal-elements-aware sift_down variant Kuan-Wei Chiu
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Kuan-Wei Chiu @ 2025-06-10 21:55 UTC (permalink / raw)
  To: corbet, colyli, kent.overstreet, akpm, robertpang
  Cc: linux-kernel, linux-doc, linux-bcache, jserv, Kuan-Wei Chiu,
	stable

This patch series introduces equality-aware variants of the min heap
API that use a top-down heapify strategy to improve performance when
many elements are equal under the comparison function. It also updates
the documentation accordingly and modifies bcache to use the new APIs
to fix a performance regression caused by the switch to the generic min
heap library.

In particular, invalidate_buckets_lru() in bcache suffered from
increased comparison overhead due to the bottom-up strategy introduced
in commit 866898efbb25 ("bcache: remove heap-related macros and switch
to generic min_heap"). The regression is addressed by switching to the
equality-aware variants and using the inline versions to avoid function
call overhead in this hot path.

Cc: stable@vger.kernel.org
---

To avoid duplicated effort and expedite resolution, Robert kindly
agreed that I should submit my already-completed series instead. Many
thanks to him for his cooperation and support.

Kuan-Wei Chiu (8):
  lib min_heap: Add equal-elements-aware sift_down variant
  lib min_heap: Add typedef for sift_down function pointer
  lib min_heap: add eqaware variant of min_heapify_all()
  lib min_heap: add eqaware variant of min_heap_pop()
  lib min_heap: add eqaware variant of min_heap_pop_push()
  lib min_heap: add eqaware variant of min_heap_del()
  Documentation/core-api: min_heap: Document _eqaware variants of
    min-heap APIs
  bcache: Fix the tail IO latency regression by using equality-aware min
    heap API

 Documentation/core-api/min_heap.rst |  20 +++++
 drivers/md/bcache/alloc.c           |  15 ++--
 include/linux/min_heap.h            | 131 +++++++++++++++++++++++-----
 lib/min_heap.c                      |  23 +++--
 4 files changed, 154 insertions(+), 35 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-06-14  1:31 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 21:55 [PATCH 0/8] Fix bcache regression with equality-aware heap APIs Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 1/8] lib min_heap: Add equal-elements-aware sift_down variant Kuan-Wei Chiu
2025-06-12 13:00   ` Robert Pang
2025-06-13  6:17     ` Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 2/8] lib min_heap: Add typedef for sift_down function pointer Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 3/8] lib min_heap: add eqaware variant of min_heapify_all() Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 4/8] lib min_heap: add eqaware variant of min_heap_pop() Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 5/8] lib min_heap: add eqaware variant of min_heap_pop_push() Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 6/8] lib min_heap: add eqaware variant of min_heap_del() Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 7/8] Documentation/core-api: min_heap: Document _eqaware variants of min-heap APIs Kuan-Wei Chiu
2025-06-10 21:55 ` [PATCH 8/8] bcache: Fix the tail IO latency regression by using equality-aware min heap API Kuan-Wei Chiu
2025-06-12  1:48 ` [PATCH 0/8] Fix bcache regression with equality-aware heap APIs Andrew Morton
2025-06-12  1:54   ` Andrew Morton
2025-06-13  6:15   ` Kuan-Wei Chiu
2025-06-13 14:26     ` Robert Pang
2025-06-13 18:04       ` Andrew Morton
2025-06-13 23:19         ` Kuan-Wei Chiu
2025-06-14  1:31           ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).