From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Tom Herbert <tom@herbertland.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
John Fastabend <john.fastabend@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
David Miller <davem@davemloft.net>,
Or Gerlitz <gerlitz.or@gmail.com>,
Eric Dumazet <edumazet@google.com>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
Alexander Duyck <alexander.duyck@gmail.com>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Daniel Borkmann <borkmann@iogearbox.net>,
Marek Majkowski <marek@cloudflare.com>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
Florian Westphal <fw@strlen.de>, Paolo Abeni <pabeni@redhat.com>,
John Fastabend <john.r.fastabend@intel.com>,
Amir Vadai <amirva@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Vladislav Yasevich <vyasevich@gmail.com>,
brouer@redhat.com
Subject: Re: Bypass at packet-page level (Was: Optimizing instruction-cache, more packets at each stage)
Date: Thu, 28 Jan 2016 18:04:38 +0100 [thread overview]
Message-ID: <20160128180438.59dbb937@redhat.com> (raw)
In-Reply-To: <CALx6S36nQ6-PnyDUrQseeeNYJM1wnPSkjcERw0GehzMYSUxR6w@mail.gmail.com>
On Thu, 28 Jan 2016 08:37:07 -0800
Tom Herbert <tom@herbertland.com> wrote:
> On Thu, Jan 28, 2016 at 4:45 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > On Thu, 2016-01-28 at 10:25 +0100, Jesper Dangaard Brouer wrote:
> >
> >> Yes, that is exactly what I'm contemplating :-) That is idea "(1)".
> >>
> >> A natural extension to this work, which I expect Tom will love, is to
> >> also use the idea for RPS. Once we have a SKB list in stack/GRO-layer,
> >> then we could build a local sk_buff_head list for each remote CPU, by
> >> calling get_rps_cpu(). And then enqueue_list_to_backlog, by a
> >> skb_queue_splice_tail(&cpu_list, &cpu->sd->input_pkt_queue) call.
> >>
> >> This would amortize the cost of transferring packets to a remote CPU,
> >> which Eric AFAIK points out is costing approx ~133ns.
> >>
> >
> > Jesper, RPS and RFS already defer sending the IPI and submit batches to
> > remote cpus.
> >
> > See commits
> >
> > e326bed2f47d0365da5a8faaf8ee93ed2d86325b ("rps: immediate send IPI in
> > process_backlog()")
> >
> > 88751275b8e867d756e4f86ae92afe0232de129f ("rps: shortcut
> > net_rps_action()")
> >
> > And of course all the discussions we had to come up with
> > 0a9627f2649a02bea165cfd529d7bcb625c2fcad ("rps: Receive Packet
> > Steering")
> >
> > The current state :
> >
> > net_rps_action_and_irq_enable() sends the IPI at the end of
> > net_rx_action() once all NAPI handlers have been called, and therefore
> > have accumulated packets and cook rps_ipi_list (via calls to
> > rps_ipi_queued() from enqueue_to_backlog())
Yes, thanks for pointing this out. Then we already have amortized the
IPI call. Great.
> > Adding another stage in the pipeline would not help.
> >
> skbs are enqueued on a CPU queue one at at time through
> enqueue_to_backlog. It would be nice to do that as a batch of skbs.
Yes, this was what I was looking at doing, a bulk enqueue to backlog.
Thus, amortizing the lock. And if some remote CPU is reading/using
input_pkt_queue, then we don't bounce that cache line.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2016-01-28 17:04 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 13:22 Optimizing instruction-cache, more packets at each stage Jesper Dangaard Brouer
2016-01-15 13:32 ` Hannes Frederic Sowa
2016-01-15 14:17 ` Jesper Dangaard Brouer
2016-01-15 13:36 ` David Laight
2016-01-15 14:00 ` Jesper Dangaard Brouer
2016-01-15 14:38 ` Felix Fietkau
2016-01-18 11:54 ` Jesper Dangaard Brouer
2016-01-18 17:01 ` Eric Dumazet
2016-01-25 0:08 ` Florian Fainelli
2016-01-15 20:47 ` David Miller
2016-01-18 10:27 ` Jesper Dangaard Brouer
2016-01-18 16:24 ` David Miller
2016-01-20 22:20 ` Or Gerlitz
2016-01-20 23:02 ` Eric Dumazet
2016-01-20 23:27 ` Tom Herbert
2016-01-21 11:27 ` Jesper Dangaard Brouer
2016-01-21 12:49 ` Or Gerlitz
2016-01-21 13:57 ` Jesper Dangaard Brouer
2016-01-21 18:56 ` David Miller
2016-01-21 22:45 ` Or Gerlitz
2016-01-21 22:59 ` David Miller
2016-01-21 16:38 ` Eric Dumazet
2016-01-21 18:54 ` David Miller
2016-01-24 14:28 ` Jesper Dangaard Brouer
2016-01-24 14:44 ` Michael S. Tsirkin
2016-01-24 17:28 ` John Fastabend
2016-01-25 13:15 ` Bypass at packet-page level (Was: Optimizing instruction-cache, more packets at each stage) Jesper Dangaard Brouer
2016-01-25 17:09 ` Tom Herbert
2016-01-25 17:50 ` John Fastabend
2016-01-25 21:32 ` Tom Herbert
2016-01-25 21:58 ` John Fastabend
2016-01-25 22:10 ` Jesper Dangaard Brouer
2016-01-27 20:47 ` Jesper Dangaard Brouer
2016-01-27 21:56 ` Alexei Starovoitov
2016-01-28 9:52 ` Jesper Dangaard Brouer
2016-01-28 12:54 ` Eric Dumazet
2016-01-28 13:25 ` Eric Dumazet
2016-01-28 16:43 ` Tom Herbert
2016-01-28 2:50 ` Tom Herbert
2016-01-28 9:25 ` Jesper Dangaard Brouer
2016-01-28 12:45 ` Eric Dumazet
2016-01-28 16:37 ` Tom Herbert
2016-01-28 16:43 ` Eric Dumazet
2016-01-28 17:04 ` Jesper Dangaard Brouer [this message]
2016-01-24 20:09 ` Optimizing instruction-cache, more packets at each stage Tom Herbert
2016-01-24 21:41 ` John Fastabend
2016-01-24 23:50 ` Tom Herbert
2016-01-21 12:23 ` Jesper Dangaard Brouer
2016-01-21 16:38 ` Tom Herbert
2016-01-21 17:48 ` Eric Dumazet
2016-01-22 12:33 ` Jesper Dangaard Brouer
2016-01-22 14:33 ` Eric Dumazet
2016-01-22 17:07 ` Tom Herbert
2016-01-22 17:17 ` Jesper Dangaard Brouer
2016-02-02 16:13 ` Or Gerlitz
2016-02-02 16:37 ` Eric Dumazet
2016-01-18 16:53 ` Eric Dumazet
2016-01-18 17:36 ` Tom Herbert
2016-01-18 17:49 ` Jesper Dangaard Brouer
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=20160128180438.59dbb937@redhat.com \
--to=brouer@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=amirva@gmail.com \
--cc=borkmann@iogearbox.net \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=fw@strlen.de \
--cc=gerlitz.or@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=john.fastabend@gmail.com \
--cc=john.r.fastabend@intel.com \
--cc=marek@cloudflare.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tom@herbertland.com \
--cc=vyasevich@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).