linux-kernel-mentees.lists.linuxfoundation.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH 0/2] reorder members of structures in virtio_net for optimization
@ 2020-09-30  5:17 Anant Thazhemadam
  2020-09-30  5:17 ` [Linux-kernel-mentees] [PATCH 1/2] net: reorder members of virtnet_info " Anant Thazhemadam
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anant Thazhemadam @ 2020-09-30  5:17 UTC (permalink / raw)
  To: mst, jasowang, davem, kuba, ast, daniel, hawk, john.fastabend
  Cc: Anant Thazhemadam, netdev, linux-kernel, virtualization, bpf,
	linux-kernel-mentees

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(-)

-- 
2.25.1
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-03 18:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30  5:17 [Linux-kernel-mentees] [PATCH 0/2] reorder members of structures in virtio_net for optimization Anant Thazhemadam
2020-09-30  5:17 ` [Linux-kernel-mentees] [PATCH 1/2] net: reorder members of virtnet_info " Anant Thazhemadam
2020-09-30  5:17 ` [Linux-kernel-mentees] [PATCH 2/2] net: reorder members of receive_queue in virtio_net " Anant Thazhemadam
2020-10-03  2:06 ` [Linux-kernel-mentees] [PATCH 0/2] reorder members of structures " David Miller
2020-10-03 18:43   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).