Files
linux/include/linux
Kuan-Wei Chiu 03ec56d084 lib min_heap: avoid indirect function call by providing default swap
The non-inline min heap API can result in an indirect function call to the
custom swap function.  This becomes particularly costly when
CONFIG_MITIGATION_RETPOLINE is enabled, as indirect function calls are
expensive in this case.

To address this, copy the code from lib/sort.c and provide a default
builtin swap implementation that performs element swaps based on the
element size.  This change allows most users to avoid the overhead of
indirect function calls, improving efficiency.

Link: https://lkml.kernel.org/r/20241020040200.939973-4-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Coly Li <colyli@suse.de>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: "Liang, Kan" <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Sakai <msakai@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-11-05 17:12:35 -08:00
..
2024-09-01 10:04:56 -04:00
2024-08-29 04:32:32 -06:00
2024-08-28 06:53:58 -07:00
2024-10-22 15:42:56 -07:00
2024-07-08 01:51:05 -06:00
2024-09-03 21:15:36 -07:00
2024-06-24 18:29:20 +02:00
2024-10-01 17:01:40 +02:00
2024-09-09 16:39:05 -07:00
2024-08-29 10:39:37 +02:00
2024-08-23 20:50:19 +02:00
2024-07-31 13:49:48 +01:00
2024-08-08 17:15:02 +02:00
2024-06-24 22:24:56 -07:00
2024-08-27 14:12:51 +02:00
2024-09-03 21:15:46 -07:00
2024-09-20 18:28:26 +03:00
2024-09-01 20:26:03 -07:00
2024-09-09 16:39:04 -07:00
2024-07-03 19:30:23 -07:00
2024-07-10 12:14:54 -07:00
2024-08-11 17:04:29 +01:00
2024-07-31 09:57:18 -07:00
2024-09-03 21:15:44 -07:00
2024-07-28 16:47:51 -06:00
2024-09-23 15:03:30 -04:00
2024-06-24 22:25:02 -07:00
2024-08-30 08:22:38 +02:00
2024-09-19 14:25:32 -05:00
2024-09-19 14:25:34 -05:00
2024-09-17 01:06:59 -07:00
2024-09-05 11:14:14 +02:00
2024-11-05 17:12:31 -08:00
2024-11-05 17:12:28 -08:00
2024-09-11 20:44:31 -07:00
2024-09-11 20:44:32 -07:00
2024-08-12 23:50:58 +05:30
2024-07-10 07:59:03 +02:00
2024-08-06 13:42:40 +02:00
2024-09-12 12:20:39 +02:00
2024-09-09 16:39:04 -07:00
2024-09-01 20:25:43 -07:00
2024-06-24 18:16:44 +01:00