[PATCH 2/2] dim: pass dim_sample to net_dim() by reference
Jakub Kicinski
kuba at kernel.org
Wed Oct 30 16:48:05 PDT 2024
On Wed, 30 Oct 2024 13:49:08 -0600 Caleb Sander Mateos wrote:
> 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.
Looks like patch 1 didn't get CCed to netdev. Please repost?
--
pw-bot: cr
More information about the Linux-mediatek
mailing list