Kuan-Wei Chiu 866898efbb 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
Link: https://lkml.kernel.org/r/20240524152958.919343-16-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Acked-by: Coly Li <colyli@suse.de>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Brian Foster <bfoster@redhat.com>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Sakai <msakai@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-06-24 22:25:00 -07:00
..
2024-06-21 12:55:12 +02:00
2024-05-22 10:45:12 -07:00
2024-06-12 16:58:05 -07:00
2024-05-16 08:50:32 -07:00
2024-05-23 12:04:36 -07:00
2024-06-22 07:58:21 -07:00
2024-06-08 10:48:11 -07:00
2024-05-23 00:29:19 +02:00
2024-05-17 09:05:46 -07:00
2024-05-14 18:25:53 -07:00
2024-05-16 08:56:49 -07:00
2024-05-21 09:51:42 -07:00
2024-05-23 12:04:36 -07:00
2024-06-13 14:19:57 -06:00
2024-05-17 13:01:24 +02:00
2024-05-23 12:09:22 -07:00
2024-05-22 10:41:14 -07:00
2024-05-27 08:18:31 -07:00
2024-05-23 12:04:36 -07:00
2024-05-07 23:40:46 +02:00
2024-06-21 14:28:28 -07:00
2024-05-08 19:21:51 +01:00
2024-04-29 22:29:44 +02:00
2024-06-21 14:28:28 -07:00
2024-05-23 12:04:36 -07:00
2024-05-22 10:45:12 -07:00
2024-05-23 12:04:36 -07:00
2024-05-24 10:24:49 -07:00
2024-04-29 16:45:53 +02:00