public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* Re: [pbs-devel] [PATCH proxmox-backup-restore-image 4/4] add workaround kernel patch for vsock panics
@ 2021-04-26 18:04 Dietmar Maurer
  0 siblings, 0 replies; 3+ messages in thread
From: Dietmar Maurer @ 2021-04-26 18:04 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stefan Reiter

Such small buffer sizes can reduce performance. I usually go
for a minimum of 256K.

So do we really need this?

What is a 128 MiB RAM machine???


> On 04/26/2021 3:04 PM Stefan Reiter <s.reiter@proxmox.com> wrote:
> 
>  
> Allocation failures for vsock packet buffers occur routinely when
> downloading more than one stream at the same time, with less then 512
> MiB of RAM it sometimes even occurs for single downloads.
> 
> This appears to fix it in all of my reproducer scenarios, tested with up
> to 6 downloads at once in a 128 MiB RAM machine.
> 
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>  .../0003-vsock-reduce-packet-size.patch       | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)
>  create mode 100644 src/patches/kernel/0003-vsock-reduce-packet-size.patch
> 
> diff --git a/src/patches/kernel/0003-vsock-reduce-packet-size.patch b/src/patches/kernel/0003-vsock-reduce-packet-size.patch
> new file mode 100644
> index 0000000..378da53
> --- /dev/null
> +++ b/src/patches/kernel/0003-vsock-reduce-packet-size.patch
> @@ -0,0 +1,36 @@
> +From a437d428733881f408b5d42eb75812600083cb75 Mon Sep 17 00:00:00 2001
> +From: Stefan Reiter <s.reiter@proxmox.com>
> +Date: Mon, 26 Apr 2021 14:08:36 +0200
> +Subject: [PATCH] vsock: reduce packet size
> +
> +Reduce the maximum packet size to avoid allocation errors in VMs with
> +very little memory available (since the buffer needs a contiguous
> +block of memory, which can get rare for 64kB blocks).
> +
> +4kB used to be the default, and according to [0] increasing it makes
> +the difference between ~25Gb/s and ~40Gb/s - certainly a lot faster,
> +but both within the realm of unreachable for our restore scenario.
> +
> +[0] https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/
> +
> +Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> +---
> + include/linux/virtio_vsock.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h
> +index dc636b727179..18c09ff72929 100644
> +--- a/include/linux/virtio_vsock.h
> ++++ b/include/linux/virtio_vsock.h
> +@@ -9,7 +9,7 @@
> + 
> + #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE	(1024 * 4)
> + #define VIRTIO_VSOCK_MAX_BUF_SIZE		0xFFFFFFFFUL
> +-#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE		(1024 * 64)
> ++#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE		(1024 * 4)
> + 
> + enum {
> + 	VSOCK_VQ_RX     = 0, /* for host to guest data */
> +-- 
> +2.20.1
> +
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel




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

* Re: [pbs-devel] [PATCH proxmox-backup-restore-image 4/4] add workaround kernel patch for vsock panics
@ 2021-04-27  6:13 Dietmar Maurer
  0 siblings, 0 replies; 3+ messages in thread
From: Dietmar Maurer @ 2021-04-27  6:13 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stefan Reiter

Answering myself, after talking with Thomas:

> On 04/26/2021 8:04 PM Dietmar Maurer <dietmar@proxmox.com> wrote:
> 
>  
> Such small buffer sizes can reduce performance. I usually go
> for a minimum of 256K.
> 
> So do we really need this?

This is simply an optimization to reduce space usage. Performance
is still good enough...

> What is a 128 MiB RAM machine???

This is the restore VM ...

> 
> 
> > On 04/26/2021 3:04 PM Stefan Reiter <s.reiter@proxmox.com> wrote:
> > 
> >  
> > Allocation failures for vsock packet buffers occur routinely when
> > downloading more than one stream at the same time, with less then 512
> > MiB of RAM it sometimes even occurs for single downloads.
> > 
> > This appears to fix it in all of my reproducer scenarios, tested with up
> > to 6 downloads at once in a 128 MiB RAM machine.
> > 
> > Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> > ---
> >  .../0003-vsock-reduce-packet-size.patch       | 36 +++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >  create mode 100644 src/patches/kernel/0003-vsock-reduce-packet-size.patch
> > 
> > diff --git a/src/patches/kernel/0003-vsock-reduce-packet-size.patch b/src/patches/kernel/0003-vsock-reduce-packet-size.patch
> > new file mode 100644
> > index 0000000..378da53
> > --- /dev/null
> > +++ b/src/patches/kernel/0003-vsock-reduce-packet-size.patch
> > @@ -0,0 +1,36 @@
> > +From a437d428733881f408b5d42eb75812600083cb75 Mon Sep 17 00:00:00 2001
> > +From: Stefan Reiter <s.reiter@proxmox.com>
> > +Date: Mon, 26 Apr 2021 14:08:36 +0200
> > +Subject: [PATCH] vsock: reduce packet size
> > +
> > +Reduce the maximum packet size to avoid allocation errors in VMs with
> > +very little memory available (since the buffer needs a contiguous
> > +block of memory, which can get rare for 64kB blocks).
> > +
> > +4kB used to be the default, and according to [0] increasing it makes
> > +the difference between ~25Gb/s and ~40Gb/s - certainly a lot faster,
> > +but both within the realm of unreachable for our restore scenario.
> > +
> > +[0] https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/




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

* [pbs-devel] [PATCH proxmox-backup-restore-image 4/4] add workaround kernel patch for vsock panics
  2021-04-26 13:04 [pbs-devel] [PATCH proxmox-backup 1/4] file-restore: add size to image files and components Stefan Reiter
@ 2021-04-26 13:04 ` Stefan Reiter
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Reiter @ 2021-04-26 13:04 UTC (permalink / raw)
  To: pbs-devel

Allocation failures for vsock packet buffers occur routinely when
downloading more than one stream at the same time, with less then 512
MiB of RAM it sometimes even occurs for single downloads.

This appears to fix it in all of my reproducer scenarios, tested with up
to 6 downloads at once in a 128 MiB RAM machine.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
 .../0003-vsock-reduce-packet-size.patch       | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 src/patches/kernel/0003-vsock-reduce-packet-size.patch

diff --git a/src/patches/kernel/0003-vsock-reduce-packet-size.patch b/src/patches/kernel/0003-vsock-reduce-packet-size.patch
new file mode 100644
index 0000000..378da53
--- /dev/null
+++ b/src/patches/kernel/0003-vsock-reduce-packet-size.patch
@@ -0,0 +1,36 @@
+From a437d428733881f408b5d42eb75812600083cb75 Mon Sep 17 00:00:00 2001
+From: Stefan Reiter <s.reiter@proxmox.com>
+Date: Mon, 26 Apr 2021 14:08:36 +0200
+Subject: [PATCH] vsock: reduce packet size
+
+Reduce the maximum packet size to avoid allocation errors in VMs with
+very little memory available (since the buffer needs a contiguous
+block of memory, which can get rare for 64kB blocks).
+
+4kB used to be the default, and according to [0] increasing it makes
+the difference between ~25Gb/s and ~40Gb/s - certainly a lot faster,
+but both within the realm of unreachable for our restore scenario.
+
+[0] https://stefano-garzarella.github.io/posts/2019-11-08-kvmforum-2019-vsock/
+
+Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
+---
+ include/linux/virtio_vsock.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/linux/virtio_vsock.h b/include/linux/virtio_vsock.h
+index dc636b727179..18c09ff72929 100644
+--- a/include/linux/virtio_vsock.h
++++ b/include/linux/virtio_vsock.h
+@@ -9,7 +9,7 @@
+ 
+ #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE	(1024 * 4)
+ #define VIRTIO_VSOCK_MAX_BUF_SIZE		0xFFFFFFFFUL
+-#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE		(1024 * 64)
++#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE		(1024 * 4)
+ 
+ enum {
+ 	VSOCK_VQ_RX     = 0, /* for host to guest data */
+-- 
+2.20.1
+
-- 
2.20.1





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

end of thread, other threads:[~2021-04-27  6:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 18:04 [pbs-devel] [PATCH proxmox-backup-restore-image 4/4] add workaround kernel patch for vsock panics Dietmar Maurer
  -- strict thread matches above, loose matches on Subject: below --
2021-04-27  6:13 Dietmar Maurer
2021-04-26 13:04 [pbs-devel] [PATCH proxmox-backup 1/4] file-restore: add size to image files and components Stefan Reiter
2021-04-26 13:04 ` [pbs-devel] [PATCH proxmox-backup-restore-image 4/4] add workaround kernel patch for vsock panics Stefan Reiter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal