diff options
author | Kuan-Wei Chiu <visitorckw@gmail.com> | 2024-04-06 02:02:25 +0800 |
---|---|---|
committer | Kuan-Wei Chiu <visitorckw@gmail.com> | 2024-04-26 08:06:41 +0800 |
commit | 940c306fd77984112185b93c4edd9c8fc7e84194 (patch) | |
tree | c0d3d906781530e32964a25f8ecb6d12da186730 /fs/pipe.c | |
parent | afa5721abaaaa8e080d16aa18bb3acc559295bd7 (diff) |
bcachefs: Remove heap-related macros and switch to generic min_heaprefactor-heap
Drop the heap-related macros from bcachefs and replacing them with the
generic min_heap implementation from include/linux. By doing so, code
readability is improved by using functions instead of macros. Moreover,
the min_heap implementation in include/linux adopts a bottom-up
variation compared to the textbook version currently used in bcachefs.
This bottom-up variation allows for approximately 50% reduction in the
number of comparison operations during heap siftdown, without changing
the number of swaps, thus making it more efficient.
Link: https://lkml.kernel.org/ioyfizrzq7w7mjrqcadtzsfgpuntowtjdw5pgn4qhvsdp4mqqg@nrlek5vmisbu
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/pipe.c')
0 files changed, 0 insertions, 0 deletions