Re: [PATCH net-next 3/3] net: Move flush list retrieval to where it is used.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 28/06/2024 12.18, Sebastian Andrzej Siewior wrote:
The bpf_net_ctx_get_.*_flush_list() are used at the top of the function.
This means the variable is always assigned even if unused. By moving the
function to where it is used, it is possible to delay the initialisation
until it is unavoidable.
Not sure how much this gains in reality but by looking at bq_enqueue()
(in devmap.c) gcc pushes one register less to the stack. \o/.

  Move flush list retrieval to where it is used.

Signed-off-by: Sebastian Andrzej Siewior<bigeasy@xxxxxxxxxxxxx>
---
  kernel/bpf/cpumap.c | 6 ++++--
  kernel/bpf/devmap.c | 3 ++-
  net/xdp/xsk.c       | 6 ++++--
  3 files changed, 10 insertions(+), 5 deletions(-)

Nice small optimization :-)

Acked-by: Jesper Dangaard Brouer <hawk@xxxxxxxxxx>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux