mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] platform/x86/amd/pmf: Clean up undesirable function outlining
@ 2026-09-01 15:02 Rong Zhang
  2026-09-01 15:02 ` [PATCH 1/5] platform/x86/amd/pmf: Inline !AMD_PMF_DEBUG stub Rong Zhang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Rong Zhang @ 2026-09-01 15:02 UTC (permalink / raw)
  To: Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
	Sanket Goswami, Mario Limonciello (AMD)
  Cc: platform-driver-x86, linux-kernel, Rong Zhang

The amd-pmf driver is notably bloated due to undesirable function
outlining and linkage. Simple and dump helper functions as well as
wrappers should really be static inline functions instead of global ones
from the very beginning, or else they are prone to the overhead of
function outlining and linkage, which bloats themselves and their
callers.

The series converts all these helper functions and wrappers into static
inline functions, and shrink the module (!CONFIG_AMD_PMF_DEBUG &&
CONFIG_AMD_PMF_UTIL_SUPPORT) size by 1472 Bytes (GCC 16 -O2):

      text       data        bss      total filename	(before)
     26810      31672       2768      61250 amd-pmf.ko

      text       data        bss      total filename	(after)
     26046      30964       2768      59778 amd-pmf.ko

As for CONFIG_AMD_PMF_DEBUG && CONFIG_AMD_PMF_UTIL_SUPPORT builds, the
module size is shrunk by 1187 Bytes:

      text       data        bss      total filename	(before)
     34593      45500       2784      82877 amd-pmf.ko

      text       data        bss      total filename	(after)
     33988      44918       2784      81690 amd-pmf.ko

This should also optimize the performance a little bit theoretically,
though it's probably not very important on modern hardware anyway.

Signed-off-by: Rong Zhang <i@rong.moe>
---
Rong Zhang (5):
      platform/x86/amd/pmf: Inline !AMD_PMF_DEBUG stub
      platform/x86/amd/pmf: Inline simple helper functions of Core Layer
      platform/x86/amd/pmf: Inline simple helper function of SPS Layer
      platform/x86/amd/pmf: Inline simple helper function of Smart PC TA interfaces
      platform/x86/amd/pmf: Inline wrappers of ap{mf,ts}_if_call_store_buffer()

 drivers/platform/x86/amd/pmf/acpi.c |  76 +-----------------
 drivers/platform/x86/amd/pmf/core.c |  22 ------
 drivers/platform/x86/amd/pmf/pmf.h  | 150 +++++++++++++++++++++++++++++++-----
 drivers/platform/x86/amd/pmf/spc.c  |  15 ----
 drivers/platform/x86/amd/pmf/sps.c  |   5 --
 5 files changed, 131 insertions(+), 137 deletions(-)
---
base-commit: 9ffed84a24d60ec506d8961fe138f0baa92fdbd0
change-id: 6f1861db-amd-pmf-fix-outlining-204546e884cf

Thanks,
Rong


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-01 15:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-01 15:02 [PATCH 0/5] platform/x86/amd/pmf: Clean up undesirable function outlining Rong Zhang
2026-09-01 15:02 ` [PATCH 1/5] platform/x86/amd/pmf: Inline !AMD_PMF_DEBUG stub Rong Zhang
2026-09-01 15:02 ` [PATCH 2/5] platform/x86/amd/pmf: Inline simple helper functions of Core Layer Rong Zhang
2026-09-01 15:02 ` [PATCH 3/5] platform/x86/amd/pmf: Inline simple helper function of SPS Layer Rong Zhang
2026-09-01 15:02 ` [PATCH 4/5] platform/x86/amd/pmf: Inline simple helper function of Smart PC TA interfaces Rong Zhang
2026-09-01 15:02 ` [PATCH 5/5] platform/x86/amd/pmf: Inline wrappers of ap{mf,ts}_if_call_store_buffer() Rong Zhang
2026-09-01 15:09 ` [PATCH 0/5] platform/x86/amd/pmf: Clean up undesirable function outlining Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®