Files
linux-stable-mirror/include/linux
Will DeaconandGreg Kroah-Hartman 1fc8b74dc5 vsock/virtio: Resize receive buffers so that each SKB fits in a 4K page
[ Upstream commit 03a92f036a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:25:59 +02:00
..
2024-06-12 11:03:08 +02:00
2024-07-05 09:31:59 +02:00
2024-12-14 19:53:51 +01:00
2024-10-17 15:21:32 +02:00
2024-03-26 18:21:02 -04:00
2024-12-14 19:54:37 +01:00
2025-07-06 10:58:04 +02:00
2025-06-04 14:40:25 +02:00
2025-08-15 12:04:54 +02:00
2024-06-12 11:03:21 +02:00
2025-02-01 18:30:05 +01:00
2025-03-07 16:56:37 +01:00
2025-05-22 14:10:00 +02:00
2024-10-17 15:21:12 +02:00