Thread (24 messages) 24 messages, 6 authors, 2026-01-12

Re: [PATCH v4 4/9] vsock/virtio: Resize receive buffers so that each SKB fits in a 4K page

From: David Woodhouse <dwmw2@infradead.org>
Date: 2026-01-08 16:33:46
Also in: lkml, virtualization

On Thu, 2025-07-17 at 10:01 +0100, Will Deacon wrote:
-#define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE	(1024 * 4)
+/* Dimension the RX SKB so that the entire thing fits exactly into
+ * a single 4KiB page. This avoids wasting memory due to alloc_skb()
+ * rounding up to the next page order and also means that we
+ * don't leave higher-order pages sitting around in the RX queue.
+ */
+#define
VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE	SKB_WITH_OVERHEAD(1024 * 4)
Should this be SKB_WITH_OVERHEAD()?

Or should it subtract VIRTIO_VSOCK_SKB_HEADROOM instead?

(And also, I have use cases where I want to expand this to 64KiB. Can I
make it controllable with a sockopt? module param?)

Attachments

  • smime.p7s [application/pkcs7-signature] 5069 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help