Re: [RFC PATCH v9 19/19] af_vsock: serialize writes to shared socket
From: Stefano Garzarella <sgarzare@redhat.com>
Date: 2021-05-13 14:48:36
Also in:
kvm, lkml, virtualization
From: Stefano Garzarella <sgarzare@redhat.com>
Date: 2021-05-13 14:48:36
Also in:
kvm, lkml, virtualization
On Thu, May 13, 2021 at 04:01:50PM +0200, Stefano Garzarella wrote:
On Sat, May 08, 2021 at 07:37:35PM +0300, Arseny Krasnov wrote:quoted
This add logic, that serializes write access to single socket by multiple threads. It is implemented be adding field with TID of current writer. When writer tries to send something, it checks that field is -1(free), else it sleep in the same way as waiting for free space at peers' side. Signed-off-by: Arseny Krasnov <redacted> --- include/net/af_vsock.h | 1 + net/vmw_vsock/af_vsock.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-)I think you forgot to move this patch at the beginning of the series. It's important because in this way we can backport to stable branches easily. About the implementation, can't we just add a mutex that we hold until we have sent all the payload?
Re-thinking, I guess we can't because we have the timeout to deal with...
I need to check other implementations like TCP.
Thanks, Stefano