mbox series

[bpf-next,v1,0/4] sockmap: some performance optimizations

Message ID 20220410161042.183540-1-xiyou.wangcong@gmail.com (mailing list archive)
Headers show
Series sockmap: some performance optimizations | expand

Message

Cong Wang April 10, 2022, 4:10 p.m. UTC
From: Cong Wang <cong.wang@bytedance.com>

This patchset contains two optimizations for sockmap. The first one
eliminates a skb_clone() and the second one eliminates a memset(). After
this patchset, the throughput of UDP transmission via sockmap gets
improved by 61%.

Cong Wang (4):
  tcp: introduce tcp_read_skb()
  net: introduce a new proto_ops ->read_skb()
  skmsg: get rid of skb_clone()
  skmsg: get rid of unncessary memset()

 include/linux/net.h |  3 ++
 include/net/tcp.h   |  1 +
 include/net/udp.h   |  3 +-
 net/core/skmsg.c    | 48 ++++++++++++-------------------
 net/ipv4/af_inet.c  |  3 +-
 net/ipv4/tcp.c      | 69 +++++++++++++++++++++++++++++++++++++++------
 net/ipv4/udp.c      | 11 ++++----
 net/ipv6/af_inet6.c |  3 +-
 net/unix/af_unix.c  | 23 ++++++---------
 9 files changed, 102 insertions(+), 62 deletions(-)

Comments

Jakub Sitnicki April 26, 2022, 9:27 a.m. UTC | #1
On Sun, Apr 10, 2022 at 09:10 AM -07, Cong Wang wrote:
> From: Cong Wang <cong.wang@bytedance.com>
>
> This patchset contains two optimizations for sockmap. The first one
> eliminates a skb_clone() and the second one eliminates a memset(). After
> this patchset, the throughput of UDP transmission via sockmap gets
> improved by 61%.

That's a pretty exact number ;-)

Is this a measurement from metrics collected from a production
enviroment, or were you using a synthetic benchmark?

If it was the latter, would you be able to share the tooling?

I'm looking at extending the fio net engine with sockmap support, so
that we can have a reference benchmark. It would be helpful to see which
sockmap setup scenarios are worth focusing on.

Thanks,
Jakub
Cong Wang April 30, 2022, 5:27 p.m. UTC | #2
On Tue, Apr 26, 2022 at 2:33 AM Jakub Sitnicki <jakub@cloudflare.com> wrote:
>
> On Sun, Apr 10, 2022 at 09:10 AM -07, Cong Wang wrote:
> > From: Cong Wang <cong.wang@bytedance.com>
> >
> > This patchset contains two optimizations for sockmap. The first one
> > eliminates a skb_clone() and the second one eliminates a memset(). After
> > this patchset, the throughput of UDP transmission via sockmap gets
> > improved by 61%.
>
> That's a pretty exact number ;-)
>
> Is this a measurement from metrics collected from a production
> enviroment, or were you using a synthetic benchmark?
>
> If it was the latter, would you be able to share the tooling?

Sure, actually my colleague Jiang modified Cloudflare's TCP
sockmap code for UDP, here is the link:
https://github.com/Jiang1155/cloudflare-blog/tree/skmap-udp

>
> I'm looking at extending the fio net engine with sockmap support, so
> that we can have a reference benchmark. It would be helpful to see which
> sockmap setup scenarios are worth focusing on.
>

Sounds a good idea.

Thanks.