From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
eugenia@mellanox.com, Alexander Duyck <alexander.duyck@gmail.com>,
saeedm@mellanox.com, gerlitz.or@gmail.com, brouer@redhat.com
Subject: Re: [net-next PATCH 0/7] net: bulk alloc side and more bulk free drivers
Date: Fri, 4 Mar 2016 20:15:12 +0100 [thread overview]
Message-ID: <20160304201512.6f66a3cd@redhat.com> (raw)
In-Reply-To: <20160304163641.GA52086@ast-mbp.thefacebook.com>
On Fri, 4 Mar 2016 08:36:44 -0800
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> On Fri, Mar 04, 2016 at 02:01:14PM +0100, Jesper Dangaard Brouer wrote:
> > This patchset use the bulk ALLOC side of the kmem_cache bulk APIs, for
> > SKB allocations. The bulk free side got enabled in merge commit
> > 3134b9f019f2 ("net: mitigating kmem_cache free slowpath").
> >
> > The first two patches is a followup on the free-side, which enables
> > bulk-free in the drivers mlx4 and mlx5 (dev_kfree_skb -> napi_consume_skb).
> >
> > Rest of patchset is focused on bulk alloc-side. We start with a
> > conservative bulk alloc of 8 SKB, which all drivers using the
> > napi_alloc_skb() call will benefit from. Then the API is extended to,
> > allow driver hinting on needed SKBs (only some drivers know this
> > size), and mlx5 driver is the first user of hinting.
>
> patches 1-5 look very good to me. Should help all cases afaik.
> As far as 6-7 about hints I have a question. Does this hint
> actually makes the difference? The fixed bulk alloc of 8 probably
> easier for the main slub, but when mlx5 starts doing 'work_done' as
> a hint there will be more 'random' bulking going on.
> Was wondering whether you have the perf numbers to back up 6/7
Yes, it makes a difference. I did some performance numbers with
dropping in the mlx5 driver, plus the RX loop cache-miss avoidance.
With all my optimizations I reached 12Mpps, with this hint optimization
I could reach 13Mpps. It sounds nice also percentage wise (8.3%), but
in nanosec this optimization "only" corresponds to 6.4 ns. For real
workloads, we might see a higher "nanosec" improvement, as this invoke
kmem_cache_alloc_bulk() less times resulting in less icache-misses.
So, yes it makes a difference.
--
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
prev parent reply other threads:[~2016-03-04 19:15 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 13:01 [net-next PATCH 0/7] net: bulk alloc side and more bulk free drivers Jesper Dangaard Brouer
2016-03-04 13:01 ` [net-next PATCH 1/7] mlx5: use napi_consume_skb API to get bulk free operations Jesper Dangaard Brouer
2016-03-04 13:01 ` [net-next PATCH 2/7] mlx4: " Jesper Dangaard Brouer
2016-03-08 19:24 ` David Miller
2016-03-09 11:00 ` Jesper Dangaard Brouer
2016-03-09 16:47 ` Alexander Duyck
2016-03-09 21:03 ` David Miller
2016-03-09 21:36 ` Jesper Dangaard Brouer
2016-03-09 21:43 ` Alexander Duyck
2016-03-09 21:47 ` Jesper Dangaard Brouer
2016-03-09 22:07 ` Alexander Duyck
2016-03-10 12:15 ` [net-next PATCH V2 0/3] net: bulk free adjustment and two driver use-cases Jesper Dangaard Brouer
2016-03-10 12:15 ` [net-next PATCH V2 1/3] net: adjust napi_consume_skb to handle none-NAPI callers Jesper Dangaard Brouer
2016-03-10 12:15 ` [net-next PATCH V2 2/3] mlx4: use napi_consume_skb API to get bulk free operations Jesper Dangaard Brouer
2016-03-10 13:59 ` Sergei Shtylyov
2016-03-10 14:59 ` [net-next PATCH V3 0/3] net: bulk free adjustment and two driver use-cases Jesper Dangaard Brouer
2016-03-10 14:59 ` [net-next PATCH V3 1/3] net: adjust napi_consume_skb to handle none-NAPI callers Jesper Dangaard Brouer
2016-03-10 17:21 ` Sergei Shtylyov
2016-03-11 7:45 ` Jesper Dangaard Brouer
2016-03-11 8:43 ` [net-next PATCH V4 0/3] net: bulk free adjustment and two driver use-cases Jesper Dangaard Brouer
2016-03-11 8:43 ` [net-next PATCH V4 1/3] net: adjust napi_consume_skb to handle non-NAPI callers Jesper Dangaard Brouer
2016-03-11 8:44 ` [net-next PATCH V4 2/3] mlx4: use napi_consume_skb API to get bulk free operations Jesper Dangaard Brouer
2016-03-11 8:44 ` [net-next PATCH V4 3/3] mlx5: " Jesper Dangaard Brouer
2016-03-14 2:35 ` [net-next PATCH V4 0/3] net: bulk free adjustment and two driver use-cases David Miller
2016-03-10 14:59 ` [net-next PATCH V3 2/3] mlx4: use napi_consume_skb API to get bulk free operations Jesper Dangaard Brouer
2016-03-10 14:59 ` [net-next PATCH V3 3/3] mlx5: " Jesper Dangaard Brouer
2016-03-10 12:15 ` [net-next PATCH V2 " Jesper Dangaard Brouer
2016-03-04 13:01 ` [net-next PATCH 3/7] net: bulk alloc and reuse of SKBs in NAPI context Jesper Dangaard Brouer
2016-03-13 14:06 ` Rana Shahout
2016-03-14 6:55 ` Jesper Dangaard Brouer
2016-03-04 13:01 ` [net-next PATCH 4/7] mlx5: use napi_alloc_skb API to get SKB bulk allocations Jesper Dangaard Brouer
2016-03-04 13:02 ` [net-next PATCH 5/7] mlx4: " Jesper Dangaard Brouer
2016-03-04 13:02 ` [net-next PATCH 6/7] net: introduce napi_alloc_skb_hint() for more use-cases Jesper Dangaard Brouer
2016-03-04 13:02 ` [net-next PATCH 7/7] mlx5: hint the NAPI alloc skb API about the expected bulk size Jesper Dangaard Brouer
2016-03-04 16:36 ` [net-next PATCH 0/7] net: bulk alloc side and more bulk free drivers Alexei Starovoitov
2016-03-04 19:15 ` Jesper Dangaard Brouer [this message]
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=20160304201512.6f66a3cd@redhat.com \
--to=brouer@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=davem@davemloft.net \
--cc=eugenia@mellanox.com \
--cc=gerlitz.or@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.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).