netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: caleb.raitto@gmail.com, Jason Wang <jasowang@redhat.com>,
	David Miller <davem@davemloft.net>,
	Network Development <netdev@vger.kernel.org>,
	Caleb Raitto <caraitto@google.com>
Subject: Re: [PATCH net-next] virtio_net: force_napi_tx module param.
Date: Tue, 24 Jul 2018 21:38:53 +0300	[thread overview]
Message-ID: <20180724212238-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAF=yD-JmhKHhXcUdfm39t=OV+5VMT90XdGWaaKSWK+kG5UBh8Q@mail.gmail.com>

On Tue, Jul 24, 2018 at 10:01:39AM -0400, Willem de Bruijn wrote:
> On Tue, Jul 24, 2018 at 6:44 AM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Mon, Jul 23, 2018 at 04:11:19PM -0700, Caleb Raitto wrote:
> > > From: Caleb Raitto <caraitto@google.com>
> > >
> > > The driver disables tx napi if it's not certain that completions will
> > > be processed affine with tx service.
> > >
> > > Its heuristic doesn't account for some scenarios where it is, such as
> > > when the queue pair count matches the core but not hyperthread count.
> > >
> > > Allow userspace to override the heuristic. This is an alternative
> > > solution to that in the linked patch. That added more logic in the
> > > kernel for these cases, but the agreement was that this was better left
> > > to user control.
> > >
> > > Do not expand the existing napi_tx variable to a ternary value,
> > > because doing so can break user applications that expect
> > > boolean ('Y'/'N') instead of integer output. Add a new param instead.
> > >
> > > Link: https://patchwork.ozlabs.org/patch/725249/
> > > Acked-by: Willem de Bruijn <willemb@google.com>
> > > Acked-by: Jon Olson <jonolson@google.com>
> > > Signed-off-by: Caleb Raitto <caraitto@google.com>
> >
> > Is there a reason the same rule should apply to all devices?
> > If not shouldn't this be an ethtool option?
> 
> It not very likely that a guest will have multiple virtio_net devices,
> some of which have affinity_hint_set and some do not?

Just to answer this question, I do hear a lot about guests with multiple
virtio net interfaces.  These might be just the noisy few, but they do
exist.

> I'd really rather not add the extra option at all, but remove
> the affinity_hint_set requirement for now. Without more data,
> I understand the concern about cacheline bouncing if napi-tx
> would becomes the default at some point and we don't have
> data on this by then. But while it isn't default and a user has to
> opt in to napi-tx to try it that seems enough guardrail to me.
> 
> The original reason was lack of data on whether napi-tx may suffer
> from cache invalidations when tx and rx softirq are on different cpus
> and we enable tx descriptor cleaning from the rx handler (i.e., on ACK).
> >From those initial numbers it seemed to be a win even with those
> invalidations.
> 
>   https://patchwork.ozlabs.org/patch/746232/
> 
> In lieu of removing the affinity_hint_set, this boolean is the least amount
> of both new interface and implementation to allow experimentation. We
> can easily leave it as a noop eventually when we are confident that
> napi-tx can be enabled even without affinity. By comparison, an ethtool
> param would be quite a bit of new logic.

So it boils down to this: if we believe napi tx is
always a good idea, then this flag is there just in case,
and the patch is fine. If it's good for some workloads
but not others, and will be for a while, we are better off
with an ethtool flag.

What's the case here?

OTOH if you want to add more trick to the affinity hint, such
as the mentioned above # of queues matching core count,
that is also fine IMHO.

-- 
MST

  reply	other threads:[~2018-07-24 19:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 23:11 [PATCH net-next] virtio_net: force_napi_tx module param Caleb Raitto
2018-07-24  0:53 ` Stephen Hemminger
2018-07-24  1:23   ` Willem de Bruijn
2018-07-24 10:42 ` Michael S. Tsirkin
2018-07-24 14:01   ` Willem de Bruijn
2018-07-24 18:38     ` Michael S. Tsirkin [this message]
2018-07-24 20:52       ` Willem de Bruijn
2018-07-24 22:23         ` Michael S. Tsirkin
2018-07-24 22:31           ` Willem de Bruijn
2018-07-24 22:46             ` Michael S. Tsirkin
2018-07-25  0:02               ` Willem de Bruijn
2018-07-25  0:17               ` Jon Olson
2018-07-30  6:06                 ` Jason Wang
2018-08-01 22:27                   ` Michael S. Tsirkin
2018-08-28 19:57                   ` Willem de Bruijn
2018-08-29  7:56                     ` Jason Wang
2018-08-29 13:01                       ` Willem de Bruijn
2018-09-09 23:07                         ` Willem de Bruijn
2018-09-10  5:59                           ` Jason Wang
2018-07-29 16:00 ` David Miller
2018-07-29 20:33   ` Michael S. Tsirkin
2018-07-29 20:36     ` David Miller
2018-07-29 21:09     ` Willem de Bruijn
2018-07-29 21:32   ` Willem de Bruijn
2018-07-31 12:34     ` Michael S. Tsirkin
2018-08-01 15:46       ` Willem de Bruijn
2018-08-01 15:56         ` Willem de Bruijn
2018-08-01 22:25         ` Michael S. Tsirkin
2018-08-01 22:43           ` Willem de Bruijn
2018-08-01 22:48             ` Michael S. Tsirkin
2018-08-01 23:33               ` Willem de Bruijn
2018-07-30 19:51   ` Stephen Hemminger
2018-07-31  1:41     ` Jason Wang

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=20180724212238-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=caleb.raitto@gmail.com \
    --cc=caraitto@google.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.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;
as well as URLs for NNTP newsgroup(s).