]> git.baikalelectronics.ru Git - kernel.git/commit
net: zerocopy: combine pages in zerocopy_sg_from_iter()
authorEric Dumazet <edumazet@google.com>
Thu, 20 Aug 2020 15:43:59 +0000 (08:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Aug 2020 23:12:50 +0000 (16:12 -0700)
commit059be02e5faa1696d8710a0543921e22788d25dc
tree005f8e0ba94b9fa6f9ec34c9e25627fa1cd30e13
parent41812e6d1d1193c7c3fa636c926fed06233ffb5b
net: zerocopy: combine pages in zerocopy_sg_from_iter()

Currently, tcp sendmsg(MSG_ZEROCOPY) is building skbs with order-0 fragments.
Compared to standard sendmsg(), these skbs usually contain up to 16 fragments
on arches with 4KB page sizes, instead of two.

This adds considerable costs on various ndo_start_xmit() handlers,
especially when IOMMU is in the picture.

As high performance applications are often using huge pages,
we can try to combine adjacent pages belonging to same
compound page.

Tested on AMD Rome platform, with IOMMU, nominal single TCP flow speed
is roughly doubled (~55Gbit -> ~100Gbit), when user application
is using hugepages.

For reference, nominal single TCP flow speed on this platform
without MSG_ZEROCOPY is ~65Gbit.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/datagram.c