* Re: [PATCH 2/2] dim: pass dim_sample to net_dim() by reference
[not found] ` <20241030194914.3268865-2-csander@purestorage.com>
@ 2024-10-30 23:48 ` Jakub Kicinski
0 siblings, 0 replies; only message in thread
From: Jakub Kicinski @ 2024-10-30 23:48 UTC (permalink / raw)
To: Caleb Sander Mateos
Cc: Tal Gilboa, David S. Miller, Eric Dumazet, Paolo Abeni,
Simon Horman, Jonathan Corbet, Shay Agroskin, Arthur Kiyanovski,
David Arinzon, Noam Dagan, Saeed Bishara, Andrew Lunn,
Florian Fainelli, Broadcom internal kernel review list,
Michael Chan, Doug Berger, Claudiu Manoil, Vladimir Oltean,
Jian Shen, Salil Mehta, Jijie Shao, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Geetha sowjanya, Subbaraya Sundeep, hariprasad,
Felix Fietkau, Sean Wang, Mark Lee, Lorenzo Bianconi,
Matthias Brugger, AngeloGioacchino Del Regno, Saeed Mahameed,
Tariq Toukan, Leon Romanovsky, Louis Peens, Shannon Nelson,
Brett Creeley, Michael S. Tsirkin, Jason Wang, Xuan Zhuo,
Eugenio Pérez, Roy Pledge, Christophe Leroy, netdev,
linux-doc, linux-kernel, intel-wired-lan, linux-arm-kernel,
linux-mediatek, linux-rdma, oss-drivers, virtualization,
linuxppc-dev
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
^ permalink raw reply [flat|nested] only message in thread