diff options
author | 2025-07-17 10:01:11 +0100 | |
---|---|---|
committer | 2025-08-01 09:11:09 -0400 | |
commit | 03a92f036a04fed2b00d69f5f46f1a486e70dc5c (patch) | |
tree | 8e9c259031e3ed99f41fb1a4286f10f5a3afdcd8 /tools/perf/scripts/python | |
parent | vsock/virtio: Move length check to callers of virtio_vsock_skb_rx_put() (diff) | |
download | wireguard-linux-03a92f036a04fed2b00d69f5f46f1a486e70dc5c.tar.xz wireguard-linux-03a92f036a04fed2b00d69f5f46f1a486e70dc5c.zip |
vsock/virtio: Resize receive buffers so that each SKB fits in a 4K page
When allocating receive buffers for the vsock virtio RX virtqueue, an
SKB is allocated with a 4140 data payload (the 44-byte packet header +
VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE). Even when factoring in the SKB
overhead, the resulting 8KiB allocation thanks to the rounding in
kmalloc_reserve() is wasteful (~3700 unusable bytes) and results in a
higher-order page allocation on systems with 4KiB pages just for the
sake of a few hundred bytes of packet data.
Limit the vsock virtio RX buffers to 4KiB per SKB, resulting in much
better memory utilisation and removing the need to allocate higher-order
pages entirely.
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Will Deacon <will@kernel.org>
Message-Id: <20250717090116.11987-5-will@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions