linux/drivers/soc
Caleb Sander Mateos 61bf0009a7 dim: pass dim_sample to net_dim() by reference
net_dim() is currently passed a struct dim_sample argument by value.
struct dim_sample is 24 bytes. Since this is greater 16 bytes, x86-64
passes it on the stack. All callers have already initialized dim_sample
on the stack, so passing it by value requires pushing a duplicated copy
to the stack. Either witing to the stack and immediately reading it, or
perhaps dereferencing addresses relative to the stack pointer in a chain
of push instructions, seems to perform quite poorly.

In a heavy TCP workload, mlx5e_handle_rx_dim() consumes 3% of CPU time,
94% of which is attributed to the first push instruction to copy
dim_sample on the stack for the call to net_dim():
// Call ktime_get()
  0.26 |4ead2:   call   4ead7 <mlx5e_handle_rx_dim+0x47>
// Pass the address of struct dim in %rdi
       |4ead7:   lea    0x3d0(%rbx),%rdi
// Set dim_sample.pkt_ctr
       |4eade:   mov    %r13d,0x8(%rsp)
// Set dim_sample.byte_ctr
       |4eae3:   mov    %r12d,0xc(%rsp)
// Set dim_sample.event_ctr
  0.15 |4eae8:   mov    %bp,0x10(%rsp)
// Duplicate dim_sample on the stack
 94.16 |4eaed:   push   0x10(%rsp)
  2.79 |4eaf1:   push   0x10(%rsp)
  0.07 |4eaf5:   push   %rax
// Call net_dim()
  0.21 |4eaf6:   call   4eafb <mlx5e_handle_rx_dim+0x6b>

To allow the caller to reuse the struct dim_sample already on the stack,
pass the struct dim_sample by reference to net_dim().

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Arthur Kiyanovski <akiyano@amazon.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Link: https://patch.msgid.link/20241031002326.3426181-2-csander@purestorage.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-11-03 12:36:54 -08:00
..
amlogic soc: amlogic: meson-gx-socinfo: add new SoCs id 2024-08-20 17:27:27 +02:00
apple soc: apple: mailbox: error pointers are negative integers 2024-01-30 11:34:49 -08:00
aspeed
atmel ARM: at91: add support in SoC driver for new sam9x7 2024-08-07 19:24:46 +03:00
bcm SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
canaan soc: canaan: Deprecate SOC_CANAAN and use SOC_CANAAN_K210 for K210 2024-04-05 16:42:50 +01:00
cirrus soc: ep93xx: drop reference to removed EP93XX_SOC_COMMON config 2024-09-26 12:58:18 +00:00
dove
fsl dim: pass dim_sample to net_dim() by reference 2024-11-03 12:36:54 -08:00
fujitsu
gemini
hisilicon soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC 2024-04-25 02:09:46 +00:00
imx soc: add missing MODULE_DESCRIPTION() macros 2024-06-27 16:42:50 +02:00
ixp4xx soc: add missing MODULE_DESCRIPTION() macros 2024-06-27 16:42:50 +02:00
lantiq
litex drivers/soc/litex: drop obsolete dependency on COMPILE_TEST 2024-06-27 16:33:39 +02:00
loongson
mediatek soc: mediatek: mtk-mutex: Reduce type size for mtk_mutex_data members 2024-07-30 10:58:46 +02:00
microchip soc: microchip: Fix POLARFIRE_SOC_SYS_CTRL input prompt 2024-01-22 16:39:40 +00:00
nuvoton
pxa spi: pxa2xx: Use proper SSP header in soc/pxa/ssp.c 2024-03-25 00:49:17 +00:00
qcom move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
renesas soc: renesas: Enable TMU support on R-Car Gen2 2024-03-26 09:25:06 +01:00
rockchip soc: rockchip: grf: Add rk3576 default GRF values 2024-08-23 12:33:58 +02:00
samsung - New Drivers 2024-07-17 17:42:20 -07:00
sunxi soc: sunxi: sram: Constify struct regmap_config 2024-07-11 00:47:13 +08:00
tegra soc/tegra: pmc: Simplify with scoped for each OF child loop 2024-08-29 17:43:43 +02:00
ti soc: ti: pm33xx: do device_node auto cleanup 2024-08-28 12:18:02 -05:00
ux500
versatile soc: versatile: enable compile testing 2024-08-30 15:40:11 +02:00
xilinx drivers: soc: xilinx: check return status of get_api_version() 2024-06-03 13:07:57 +02:00
Kconfig soc: Add SoC driver for Cirrus ep93xx 2024-09-12 14:33:10 +00:00
Makefile soc: convert ep93xx to devicetree 2024-09-26 12:00:25 -07:00