Skip to content

reorder members of structures in virtio_net for optimization

Anant Thazhemadam bpf linux-kernel-mentees lkml netdev virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: reorder members of virtnet_info for optimizationdrivers/net/virtio_net.c+21 -210 replies
2/2net: reorder members of receive_queue in virtio_net for optimizationdrivers/net/virtio_net.c+10 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Linux-kernel-mentees][PATCH 0/2] reorder members of structures in virtio_net for optimization

The structures virtnet_info and receive_queue have byte holes in middle, and their members could do with some rearranging (order-of-declaration wise) in order to overcome this.

Rearranging the members helps in:
* elimination the byte holes in the middle of the structures
* reduce the size of the structure (virtnet_info)
* have more members stored in one cache line (as opposed to unnecessarily crossing the cacheline boundary and spanning different cachelines)

The analysis was performed using pahole.

These patches may be applied in any order.

Anant Thazhemadam (2):
net: reorder members of virtnet_info for optimization
net: reorder members of receive_queue in virtio_net for optimization

 drivers/net/virtio_net.c | 44 +++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 21 deletions(-)
Signature · 1 line
2.25.1