public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.ibm.com>
To: Si-Wei Liu <si-wei.liu@oracle.com>
Cc: Parav Pandit <parav@nvidia.com>,
	Heng Qi <hengqi@linux.alibaba.com>,
	Cornelia Huck <cohuck@redhat.com>,
	"virtio-comment@lists.linux.dev" <virtio-comment@lists.linux.dev>,
	Jason Wang <jasowang@redhat.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Halil Pasic <pasic@linux.ibm.com>
Subject: Re: [PATCH v5] virtio-net: clarify coalescing parameters settings
Date: Thu, 27 Jun 2024 12:37:32 +0200	[thread overview]
Message-ID: <20240627123732.0cf541b3.pasic@linux.ibm.com> (raw)
In-Reply-To: <bca1e5e8-65af-4825-b6fe-2ca3b6c41feb@oracle.com>

On Tue, 25 Jun 2024 18:14:15 -0700
Si-Wei Liu <si-wei.liu@oracle.com> wrote:

> On 6/24/2024 10:56 PM, Parav Pandit wrote:
[..]
> > I saw the need of this proposal slightly differently in the discussion with Heng in v4.
> > The way I understood is, proposed relaxation enables below Linux driver flow to work as equally as without device offering VIRTIO_NET_F_VQ_NOTF_COAL.
> >
> > Flow is:
> > 1. The device offered feature VIRTIO_NET_F_VQ_NOTF_COAL
> > 2. The virtio-net driver negotiated VIRTNET_FEATURES that has VIRTIO_NET_F_VQ_NOTF_COAL
> >
> > 3. Because VIRTIO_NET_F_VQ_NOTF_COAL is negotiated, device is not applying any coalescing on the VQ, in a good hope that driver will perform VQ notification coalescing.

I have certainly understood this differently. When
VIRTIO_NET_F_VQ_NOTF_COAL is not negotiated then the device is not supposed/allowed to do any interrupt coalescing (notification suppression may still apply).

If VIRTIO_NET_F_VQ_NOTF_COAL is negotiated the device is supposed
to/MUST do the coalescing according to the parameters as described by
the virtio spec.

Michael, Jason: Can you guys weigh in on this?

> >
> > 4. the virtio-net driver even after negotiating VIRTIO_NET_F_VQ_NOTF_COAL, still kept the its dim disabled.
> > vi->rq[queue].dim_enabled = false by default.
> >
> > 5. The virtio net driver enables dim only on user request via ethtool.
> >
> > So here, just because one is using a new driver and new device, it may get lower performance.  
> Impossible, older driver / device doesn't have coalescing advertise / 
> enabled, and new device & new driver with coalescing negotiated starts 
> safe with 0 with coalescing disabled effectively, how can it get lower 
> performance?

Si-Wei and Parav, I think it is the other way around. Without the
change proposed here, with no user/management software intervention
assumed, we are guaranteed to not see any performance regression
but also no performance benefit because of the coalescing mechanism,
because with zeros as default it is essentially dormant.

With the change proposed here however, we open up the possibility
to see either a performance improvement or a performance degradation
depending on the defaults chosen by the device and the workload (sill
assuming new device & new driver & no intervention by management
software).


> 
> >
> > Do we agree to above problem description?  
> This narrative has two problems:
> 
> - The term "lower performance" is misleading and inaccurate, the fact or 
> implication of coalescing is that it yields worse latency, causing 
> additional delay and jitter that would hurt quite a lot of real world 
> workload that is latency sensitive.  So, rather than say coalescing 
> helps performance, it should clearly tell the truth that the coalescing 
> parameter is no more than a tuning knob that has performance 
> impact/implication, being positive or negative it is very subject to the 
> guest workload. So the default disposition or initial parameters loaded 
> from device just reflects the preference of the host admin/ device 
> owner/ cloud vendor of one's own, for e.g. it is optimized for 
> throughput oriented load versus latency oriented. Be noted, generally 
> end users don't care what coalescing is about, they do not connect 
> performance to "throughput" or "bandwidth" as that in your mind.
> 

Si-Wei, I sympathies with your argument but I'm willing to tolerate this
change nevertheless.

Yes the device and via the device whoever controls these parameters can
shoot the guest in the foot, if the guest admin is not going out of his
way to do something about controlling coalescing.

But via the same mechanism we could end up in a better place as well.

Because I assume that the device and its "admin" are at least trying to
do good, I'm not straight out against this proposal, as long nothing
wonky happens with the code which is already out there, in a sense of a
split brain scenario where Linux thinks those values are 0 but they
aren't. Unfortunately can't tell you how we stand on this.

[..]
> > If no, I likely missed something in the long discussion and need to read all of it. :(
> >
> > If yes, few solutions are:
> > 1. A user intervention is must to avoid this regression. The user in the guest VM must enable DIM if the device supports it.

I don't think burdening up the users with avoiding regressions is a good
idea.

Regards,
Halil

> > Very hard to do this plumbing.
> >
> > 2. A net driver enables the DIM by default as long as VIRTIO_NET_F_VQ_NOTF_COAL is negotiated.
> > (without ethtool setting)
> >
> > 3. A device relaxes the limitation and continue to apply the coalescing, until driver overrides it.
> >
> > In my humble opinion, Heng is solving it using option #3, that tends to work with existing and future drivers who may/may not enable the DIM.
> >
> >
> >
> >  
> 


  reply	other threads:[~2024-06-27 10:37 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28  4:47 [PATCH v5] virtio-net: clarify coalescing parameters settings Heng Qi
2024-05-28  4:50 ` Heng Qi
2024-05-31  6:36   ` Heng Qi
2024-05-31  9:39     ` Cornelia Huck
2024-06-07 20:02 ` Halil Pasic
2024-06-08  2:34   ` Heng Qi
2024-06-10 12:46     ` Halil Pasic
2024-06-10 13:35       ` Heng Qi
2024-06-10 14:50         ` Michael S. Tsirkin
2024-06-10 15:12           ` Parav Pandit
2024-06-11 14:04           ` Cornelia Huck
2024-06-10 20:19         ` Halil Pasic
2024-06-11 10:40           ` Heng Qi
2024-06-11 16:29             ` Michael S. Tsirkin
2024-06-11 17:43               ` Parav Pandit
2024-06-13  6:13                 ` Michael S. Tsirkin
2024-06-17  2:27                   ` Heng Qi
2024-06-17 23:31                     ` Si-Wei Liu
2024-06-20  7:40                       ` Heng Qi
2024-06-21  1:21                         ` Si-Wei Liu
2024-06-21  3:24                           ` Heng Qi
2024-06-21 23:46                             ` Si-Wei Liu
2024-06-22  1:34                               ` Heng Qi
2024-06-25  4:51                                 ` Si-Wei Liu
2024-06-25  5:56                                   ` Parav Pandit
2024-06-26  1:14                                     ` Si-Wei Liu
2024-06-27 10:37                                       ` Halil Pasic [this message]
2024-06-27 11:27                                         ` Parav Pandit
2024-06-27 12:35                                         ` Michael S. Tsirkin
2024-06-27 12:45                                           ` Parav Pandit
2024-06-27 12:52                                             ` Michael S. Tsirkin
2024-06-27 13:03                                               ` Parav Pandit
2024-06-27 14:59                                                 ` Michael S. Tsirkin
2024-06-27 17:27                                               ` Si-Wei Liu
2024-06-27 17:14                                           ` Si-Wei Liu
2024-06-27 22:18                                             ` Michael S. Tsirkin
2024-06-28  6:56                                               ` Si-Wei Liu
2024-06-28  8:23                                                 ` Jason Wang
2024-06-28 19:31                                                   ` Si-Wei Liu
2024-06-30 17:04                                                     ` Michael S. Tsirkin
2024-07-03  6:09                                                     ` Jason Wang
2024-07-02 20:37                                                   ` Halil Pasic
2024-07-02 21:04                                                     ` Michael S. Tsirkin
2024-07-03  5:01                                                     ` Jason Wang
2024-06-29  6:47                                           ` Halil Pasic
2024-06-30 16:55                                             ` Michael S. Tsirkin
2024-07-02 21:43                                               ` Halil Pasic
2024-06-27 12:13                                       ` Parav Pandit
2024-06-27 12:42                                         ` Michael S. Tsirkin
2024-06-25  7:53                               ` Jason Wang
2024-06-25  8:06                                 ` Michael S. Tsirkin
2024-06-25  8:13                                   ` Jason Wang
2024-06-25  8:21                                     ` Michael S. Tsirkin
2024-06-11 23:03 ` Michael S. Tsirkin
2024-06-17  2:35   ` Heng Qi
2024-06-25  7:26     ` Michael S. Tsirkin

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=20240627123732.0cf541b3.pasic@linux.ibm.com \
    --to=pasic@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=si-wei.liu@oracle.com \
    --cc=virtio-comment@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /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