From: Stefano Garzarella <sgarzare@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Stefan Hajnoczi <stefanha@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] vsock/virtio: a better comment on credit update
Date: Tue, 3 Sep 2019 09:47:33 +0200 [thread overview]
Message-ID: <20190903074733.dg55ucs7jh5zvfbh@steredhat> (raw)
In-Reply-To: <20190903073748.25214-1-mst@redhat.com>
On Tue, Sep 03, 2019 at 03:38:16AM -0400, Michael S. Tsirkin wrote:
> The comment we have is just repeating what the code does.
> Include the *reason* for the condition instead.
>
> Cc: Stefano Garzarella <sgarzare@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> net/vmw_vsock/virtio_transport_common.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
> index 94cc0fa3e848..5bb70c692b1e 100644
> --- a/net/vmw_vsock/virtio_transport_common.c
> +++ b/net/vmw_vsock/virtio_transport_common.c
> @@ -307,8 +307,13 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk,
>
> spin_unlock_bh(&vvs->rx_lock);
>
> - /* We send a credit update only when the space available seen
> - * by the transmitter is less than VIRTIO_VSOCK_MAX_PKT_BUF_SIZE
> + /* To reduce the number of credit update messages,
> + * don't update credits as long as lots of space is available.
> + * Note: the limit chosen here is arbitrary. Setting the limit
> + * too high causes extra messages. Too low causes transmitter
> + * stalls. As stalls are in theory more expensive than extra
> + * messages, we set the limit to a high value. TODO: experiment
> + * with different values.
> */
> if (free_space < VIRTIO_VSOCK_MAX_PKT_BUF_SIZE) {
> virtio_transport_send_credit_update(vsk,
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
next prev parent reply other threads:[~2019-09-03 7:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 7:38 [PATCH net-next] vsock/virtio: a better comment on credit update Michael S. Tsirkin
2019-09-03 7:47 ` Stefano Garzarella [this message]
2019-09-05 7:53 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190903074733.dg55ucs7jh5zvfbh@steredhat \
--to=sgarzare@redhat.com \
--cc=davem@davemloft.net \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).