diff options
author | Kuan-Wei Chiu <visitorckw@gmail.com> | 2024-04-06 06:00:27 +0800 |
---|---|---|
committer | Kuan-Wei Chiu <visitorckw@gmail.com> | 2024-04-25 22:04:24 +0800 |
commit | afa5721abaaaa8e080d16aa18bb3acc559295bd7 (patch) | |
tree | 5b3857e9214dcb71281172f198836d6e2da0e046 /include/linux/overflow.h | |
parent | eb0932e0c40ce13a774472faa1ed54df91e3130e (diff) |
bcache: Remove heap-related macros and switch to generic min_heap
Drop the heap-related macros from bcache 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 bcache.
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: Coly Li <colyli@suse.de>
Diffstat (limited to 'include/linux/overflow.h')
0 files changed, 0 insertions, 0 deletions