Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-14 Thread Stefano Garzarella
On Mon, Oct 14, 2019 at 04:21:35PM +0800, Jason Wang wrote: > On 2019/10/14 下午4:17, Stefan Hajnoczi wrote: > > SO_VM_SOCKETS_BUFFER_SIZE might have been useful for VMCI-specific > > applications, but we should use SO_RCVBUF and SO_SNDBUF for portable > > applications in the future. Those socket

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-14 Thread Jason Wang
On 2019/10/14 下午4:17, Stefan Hajnoczi wrote: SO_VM_SOCKETS_BUFFER_SIZE might have been useful for VMCI-specific applications, but we should use SO_RCVBUF and SO_SNDBUF for portable applications in the future. Those socket options also work with other address families. I guess these sockopts

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-14 Thread Stefan Hajnoczi
On Fri, Oct 11, 2019 at 03:40:48PM +0200, Stefano Garzarella wrote: > On Sun, Sep 1, 2019 at 8:56 AM Michael S. Tsirkin wrote: > > On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > > On Wed, Jul 17,

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-11 Thread Stefano Garzarella
On Fri, Oct 11, 2019 at 10:11:19AM -0400, Michael S. Tsirkin wrote: > On Fri, Oct 11, 2019 at 03:40:48PM +0200, Stefano Garzarella wrote: > > On Sun, Sep 1, 2019 at 8:56 AM Michael S. Tsirkin wrote: > > > On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > > > > On Mon, Jul 29,

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-11 Thread Michael S. Tsirkin
On Fri, Oct 11, 2019 at 03:40:48PM +0200, Stefano Garzarella wrote: > On Sun, Sep 1, 2019 at 8:56 AM Michael S. Tsirkin wrote: > > On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > > On Wed, Jul 17,

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-10-11 Thread Stefano Garzarella
On Sun, Sep 1, 2019 at 8:56 AM Michael S. Tsirkin wrote: > On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > > Since

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-03 Thread Stefano Garzarella
On Tue, Sep 03, 2019 at 03:52:24AM -0400, Michael S. Tsirkin wrote: > On Tue, Sep 03, 2019 at 09:45:54AM +0200, Stefano Garzarella wrote: > > On Tue, Sep 03, 2019 at 12:39:19AM -0400, Michael S. Tsirkin wrote: > > > On Mon, Sep 02, 2019 at 11:57:23AM +0200, Stefano Garzarella wrote: > > > > > > >

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-03 Thread Michael S. Tsirkin
On Tue, Sep 03, 2019 at 09:45:54AM +0200, Stefano Garzarella wrote: > On Tue, Sep 03, 2019 at 12:39:19AM -0400, Michael S. Tsirkin wrote: > > On Mon, Sep 02, 2019 at 11:57:23AM +0200, Stefano Garzarella wrote: > > > > > > > > Assuming we miss nothing and buffers < 4K are broken, > > > > I think

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-03 Thread Stefano Garzarella
On Tue, Sep 03, 2019 at 12:39:19AM -0400, Michael S. Tsirkin wrote: > On Mon, Sep 02, 2019 at 11:57:23AM +0200, Stefano Garzarella wrote: > > > > > > Assuming we miss nothing and buffers < 4K are broken, > > > I think we need to add this to the spec, possibly with > > > a feature bit to relax the

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-02 Thread Michael S. Tsirkin
On Mon, Sep 02, 2019 at 11:57:23AM +0200, Stefano Garzarella wrote: > > > > Assuming we miss nothing and buffers < 4K are broken, > > I think we need to add this to the spec, possibly with > > a feature bit to relax the requirement that all buffers > > are at least 4k in size. > > > > Okay,

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-02 Thread Michael S. Tsirkin
On Mon, Sep 02, 2019 at 11:57:23AM +0200, Stefano Garzarella wrote: > On Sun, Sep 01, 2019 at 06:17:58AM -0400, Michael S. Tsirkin wrote: > > On Sun, Sep 01, 2019 at 04:26:19AM -0400, Michael S. Tsirkin wrote: > > > On Thu, Aug 01, 2019 at 03:36:16PM +0200, Stefano Garzarella wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-02 Thread Stefano Garzarella
On Sun, Sep 01, 2019 at 06:17:58AM -0400, Michael S. Tsirkin wrote: > On Sun, Sep 01, 2019 at 04:26:19AM -0400, Michael S. Tsirkin wrote: > > On Thu, Aug 01, 2019 at 03:36:16PM +0200, Stefano Garzarella wrote: > > > On Thu, Aug 01, 2019 at 09:21:15AM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-02 Thread Stefano Garzarella
On Mon, Sep 02, 2019 at 09:39:12AM +0100, Stefan Hajnoczi wrote: > On Sun, Sep 01, 2019 at 02:56:44AM -0400, Michael S. Tsirkin wrote: > > > > OK let me try to clarify. The idea is this: > > > > Let's say we queue a buffer of 4K, and we copy if len < 128 bytes. This > > means that in the worst

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-02 Thread Stefan Hajnoczi
On Sun, Sep 01, 2019 at 02:56:44AM -0400, Michael S. Tsirkin wrote: > On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > > Since

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-01 Thread Michael S. Tsirkin
On Sun, Sep 01, 2019 at 04:26:19AM -0400, Michael S. Tsirkin wrote: > On Thu, Aug 01, 2019 at 03:36:16PM +0200, Stefano Garzarella wrote: > > On Thu, Aug 01, 2019 at 09:21:15AM -0400, Michael S. Tsirkin wrote: > > > On Thu, Aug 01, 2019 at 12:47:54PM +0200, Stefano Garzarella wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-01 Thread Michael S. Tsirkin
On Thu, Aug 01, 2019 at 03:36:16PM +0200, Stefano Garzarella wrote: > On Thu, Aug 01, 2019 at 09:21:15AM -0400, Michael S. Tsirkin wrote: > > On Thu, Aug 01, 2019 at 12:47:54PM +0200, Stefano Garzarella wrote: > > > On Tue, Jul 30, 2019 at 04:42:25PM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-09-01 Thread Michael S. Tsirkin
On Fri, Aug 30, 2019 at 11:40:59AM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > Since virtio-vsock was introduced, the buffers filled by the host > > > and pushed

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-08-30 Thread Stefano Garzarella
On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > Since virtio-vsock was introduced, the buffers filled by the host > > and pushed to the guest using the vring, are directly queued in > > a per-socket list.

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-08-01 Thread Stefano Garzarella
On Thu, Aug 01, 2019 at 09:21:15AM -0400, Michael S. Tsirkin wrote: > On Thu, Aug 01, 2019 at 12:47:54PM +0200, Stefano Garzarella wrote: > > On Tue, Jul 30, 2019 at 04:42:25PM -0400, Michael S. Tsirkin wrote: > > > On Tue, Jul 30, 2019 at 11:35:39AM +0200, Stefano Garzarella wrote: > > > > (...)

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-08-01 Thread Michael S. Tsirkin
On Thu, Aug 01, 2019 at 12:47:54PM +0200, Stefano Garzarella wrote: > On Tue, Jul 30, 2019 at 04:42:25PM -0400, Michael S. Tsirkin wrote: > > On Tue, Jul 30, 2019 at 11:35:39AM +0200, Stefano Garzarella wrote: > > (...) > > > > > > > The problem here is the compatibility. Before this series

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-08-01 Thread Stefano Garzarella
On Tue, Jul 30, 2019 at 04:42:25PM -0400, Michael S. Tsirkin wrote: > On Tue, Jul 30, 2019 at 11:35:39AM +0200, Stefano Garzarella wrote: (...) > > > > The problem here is the compatibility. Before this series virtio-vsock > > and vhost-vsock modules had the RX buffer size hard-coded > >

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-30 Thread Michael S. Tsirkin
On Tue, Jul 30, 2019 at 11:35:39AM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 03:10:15PM -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 29, 2019 at 06:50:56PM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 06:19:03PM +0200, Stefano Garzarella wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-30 Thread Stefano Garzarella
On Mon, Jul 29, 2019 at 03:10:15PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 29, 2019 at 06:50:56PM +0200, Stefano Garzarella wrote: > > On Mon, Jul 29, 2019 at 06:19:03PM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 11:49:02AM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Michael S. Tsirkin
On Mon, Jul 29, 2019 at 06:41:27PM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 12:01:37PM -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Michael S. Tsirkin
On Mon, Jul 29, 2019 at 06:50:56PM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 06:19:03PM +0200, Stefano Garzarella wrote: > > On Mon, Jul 29, 2019 at 11:49:02AM -0400, Michael S. Tsirkin wrote: > > > On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Stefano Garzarella
On Mon, Jul 29, 2019 at 06:19:03PM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 11:49:02AM -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Stefano Garzarella
On Mon, Jul 29, 2019 at 12:01:37PM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > > Since

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Stefano Garzarella
On Mon, Jul 29, 2019 at 11:49:02AM -0400, Michael S. Tsirkin wrote: > On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > > Since

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Michael S. Tsirkin
On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > Since virtio-vsock was introduced, the buffers filled by the host > > > and pushed

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Michael S. Tsirkin
On Mon, Jul 29, 2019 at 05:36:56PM +0200, Stefano Garzarella wrote: > On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > > Since virtio-vsock was introduced, the buffers filled by the host > > > and pushed

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Stefano Garzarella
On Mon, Jul 29, 2019 at 10:04:29AM -0400, Michael S. Tsirkin wrote: > On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > > Since virtio-vsock was introduced, the buffers filled by the host > > and pushed to the guest using the vring, are directly queued in > > a per-socket list.

Re: [PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-29 Thread Michael S. Tsirkin
On Wed, Jul 17, 2019 at 01:30:26PM +0200, Stefano Garzarella wrote: > Since virtio-vsock was introduced, the buffers filled by the host > and pushed to the guest using the vring, are directly queued in > a per-socket list. These buffers are preallocated by the guest > with a fixed size (4 KB). >

[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket

2019-07-17 Thread Stefano Garzarella
Since virtio-vsock was introduced, the buffers filled by the host and pushed to the guest using the vring, are directly queued in a per-socket list. These buffers are preallocated by the guest with a fixed size (4 KB). The maximum amount of memory used by each socket should be controlled by the