[PATCH v2 0/2] lib min_heap: Min heap optimizations

Kuan-Wei Chiu posted 2 patches 1 year, 11 months ago
There is a newer version of this series
include/linux/min_heap.h | 44 +++++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 21 deletions(-)
[PATCH v2 0/2] lib min_heap: Min heap optimizations
Posted by Kuan-Wei Chiu 1 year, 11 months ago
Hello,

The purpose of this patch series is to enhance the existing min heap
implementation. The optimization focuses on both the heap construction
process and the number of comparisons made during the heapify
operation.

Thanks,
Kuan-Wei Chiu

---
Changes in v2:
- Use a more consistent title: "min_heap:" -> "lib min_heap:"
- Refine commit messages

v1: https://lkml.kernel.org/20231220083224.3712113-1-visitorckw@gmail.com

Kuan-Wei Chiu (2):
  lib min_heap: Optimize number of calls to min_heapify()
  lib min_heap: Optimize number of comparisons in min_heapify()

 include/linux/min_heap.h | 44 +++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

-- 
2.25.1
Re: [PATCH v2 0/2] lib min_heap: Min heap optimizations
Posted by Andrew Morton 1 year, 11 months ago
On Thu,  4 Jan 2024 04:52:57 +0800 Kuan-Wei Chiu <visitorckw@gmail.com> wrote:

> Hello,
> 
> The purpose of this patch series is to enhance the existing min heap
> implementation. The optimization focuses on both the heap construction
> process and the number of comparisons made during the heapify
> operation.
> 

The patches look nice, but the only user of this code is
kernel/events/core.c and the developers of that code aren't cc'ed, so
please rectify that.

Has Ian commented on these changes?

The amount of inlining in min_heap.h is amazing.  Was there some
special reason for this?  It makes min_heap somewhat unsuitable for
more general use.