Will Deacon
680c7d9d91
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-20 18:30:40 +02:00
..
2025-06-27 11:11:19 +01:00
2025-05-29 11:03:15 +02:00
2024-12-19 18:13:14 +01:00
2024-12-14 20:03:12 +01:00
2024-12-14 20:03:26 +01:00
2025-05-29 11:02:43 +02:00
2025-05-29 11:02:49 +02:00
2025-08-15 12:13:43 +02:00
2025-06-27 11:11:26 +01:00
2025-02-17 10:04:53 +01:00
2025-02-27 04:30:17 -08:00
2025-04-10 14:39:28 +02:00
2025-05-29 11:03:24 +02:00
2025-03-07 18:25:27 +01:00
2025-08-20 18:30:29 +02:00
2025-06-27 11:11:27 +01:00
2024-12-27 14:02:13 +01:00
2024-12-27 14:01:57 +01:00
2025-06-19 15:31:38 +02:00
2025-06-27 11:11:39 +01:00
2025-08-15 12:13:31 +02:00
2025-04-25 10:47:49 +02:00
2025-02-17 10:04:43 +01:00
2025-06-19 15:32:33 +02:00
2025-08-20 18:30:16 +02:00
2025-05-02 07:58:54 +02:00
2025-04-25 10:48:08 +02:00
2025-07-10 16:05:00 +02:00
2025-05-29 11:02:17 +02:00
2025-04-25 10:48:07 +02:00
2025-02-08 09:57:30 +01:00
2025-05-29 11:02:00 +02:00
2025-06-19 15:32:33 +02:00
2025-02-17 10:05:06 +01:00
2025-04-20 10:15:04 +02:00
2025-04-20 10:15:04 +02:00
2024-12-14 20:03:38 +01:00
2024-12-14 20:04:16 +01:00
2025-03-13 13:01:58 +01:00
2024-12-05 14:02:45 +01:00
2024-12-05 14:02:45 +01:00
2025-03-07 18:25:35 +01:00
2025-03-07 18:25:36 +01:00
2025-04-10 14:39:28 +02:00
2025-06-04 14:43:52 +02:00
2025-06-19 15:32:12 +02:00
2025-07-10 16:05:14 +02:00
2025-05-09 09:50:35 +02:00
2025-07-10 16:05:08 +02:00
2025-05-29 11:03:15 +02:00
2025-05-29 11:01:59 +02:00
2024-12-14 20:04:09 +01:00
2025-02-21 14:01:34 +01:00
2025-05-02 07:58:52 +02:00
2025-05-29 11:03:25 +02:00
2025-03-13 13:02:07 +01:00
2024-12-14 20:03:35 +01:00
2025-05-18 08:24:59 +02:00
2025-07-10 16:05:08 +02:00
2025-06-27 11:11:32 +01:00
2024-12-14 20:03:48 +01:00
2025-01-09 13:33:47 +01:00
2025-08-15 12:13:49 +02:00
2025-08-15 12:13:31 +02:00
2025-07-10 16:05:09 +02:00
2025-04-10 14:39:17 +02:00
2025-06-19 15:32:34 +02:00
2025-05-29 11:03:22 +02:00
2025-02-17 10:05:31 +01:00
2025-01-23 17:23:03 +01:00
2025-06-27 11:11:40 +01:00
2025-05-22 14:29:48 +02:00
2025-08-20 18:30:14 +02:00
2025-07-17 18:37:16 +02:00
2025-08-20 18:30:37 +02:00
2025-04-10 14:39:12 +02:00
2025-04-20 10:15:40 +02:00
2024-12-27 14:02:17 +01:00
2025-05-29 11:03:25 +02:00
2025-01-17 13:40:34 +01:00
2025-05-09 09:50:34 +02:00
2025-08-15 12:14:05 +02:00
2025-05-29 11:02:23 +02:00
2025-08-01 09:48:42 +01:00
2025-02-08 09:57:58 +01:00
2024-12-09 10:41:08 +01:00
2025-03-28 22:03:30 +01:00
2024-12-05 14:03:03 +01:00
2025-05-22 14:29:36 +02:00
2024-12-14 20:04:01 +01:00
2025-07-10 16:05:06 +02:00
2024-12-05 14:02:46 +01:00
2025-05-29 11:02:25 +02:00
2025-07-17 18:37:24 +02:00
2025-06-19 15:31:54 +02:00
2025-01-09 13:33:54 +01:00
2025-08-20 18:30:16 +02:00
2025-01-09 13:33:54 +01:00
2025-07-17 18:37:13 +02:00
2025-05-29 11:03:23 +02:00
2024-12-05 14:03:08 +01:00
2025-05-18 08:24:59 +02:00
2025-08-15 12:13:59 +02:00
2025-01-17 13:40:50 +01:00
2025-02-08 09:57:23 +01:00
2025-05-29 11:02:41 +02:00
2024-12-19 18:13:19 +01:00
2025-02-27 04:30:18 -08:00
2025-01-17 13:40:35 +01:00
2025-02-08 09:57:59 +01:00
2025-06-04 14:43:53 +02:00
2025-04-25 10:47:50 +02:00
2025-04-10 14:39:11 +02:00
2025-03-13 13:02:03 +01:00
2025-06-19 15:32:18 +02:00
2024-12-05 14:03:08 +01:00
2024-12-05 14:03:08 +01:00
2025-06-19 15:32:37 +02:00
2025-08-20 18:30:35 +02:00
2025-05-29 11:03:22 +02:00
2025-04-20 10:15:25 +02:00
2025-05-29 11:02:04 +02:00
2025-06-19 15:32:11 +02:00
2025-05-02 07:58:56 +02:00
2025-05-29 11:03:02 +02:00
2025-04-20 10:15:49 +02:00
2025-06-19 15:31:54 +02:00
2025-03-13 13:02:07 +01:00
2025-06-19 15:32:22 +02:00
2025-04-10 14:39:11 +02:00
2025-05-29 11:02:20 +02:00
2025-06-19 15:31:42 +02:00
2025-01-23 17:22:57 +01:00
2025-08-15 12:13:35 +02:00
2025-04-20 10:15:12 +02:00
2025-08-15 12:13:53 +02:00
2025-01-23 17:22:53 +01:00
2025-08-15 12:13:42 +02:00
2025-07-17 18:37:08 +02:00
2025-02-08 09:57:07 +01:00
2025-05-29 11:03:02 +02:00
2025-03-07 18:25:43 +01:00
2025-05-29 11:03:02 +02:00
2025-08-15 12:13:46 +02:00
2024-12-14 20:03:18 +01:00
2025-03-13 13:01:58 +01:00
2025-02-01 18:39:35 +01:00
2025-02-27 04:30:14 -08:00
2025-02-08 09:57:07 +01:00
2025-08-20 18:30:36 +02:00
2025-02-27 04:30:19 -08:00
2025-03-07 18:25:32 +01:00
2025-07-10 16:04:54 +02:00
2025-08-01 09:48:43 +01:00
2024-12-14 20:03:32 +01:00
2024-12-19 18:13:24 +01:00
2025-06-27 11:11:30 +01:00
2025-04-10 14:39:26 +02:00
2024-12-14 20:04:16 +01:00
2025-05-22 14:29:50 +02:00
2025-04-10 14:39:35 +02:00
2025-05-29 11:02:04 +02:00
2025-05-29 11:02:04 +02:00
2025-05-18 08:24:56 +02:00
2025-04-10 14:39:37 +02:00
2025-07-10 16:05:11 +02:00
2025-01-23 17:23:02 +01:00
2024-12-09 10:41:06 +01:00
2025-08-20 18:30:40 +02:00
2025-05-22 14:29:38 +02:00
2025-05-18 08:24:51 +02:00
2025-01-02 10:34:10 +01:00
2025-08-15 12:14:04 +02:00
2024-12-27 14:02:20 +01:00
2025-01-17 13:40:33 +01:00