]> 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)
commit27dcb88f0c15c02f60a3d8f76d0a48a337ab0212
tree005f8e0ba94b9fa6f9ec34c9e25627fa1cd30e13
parent81a8b9bf7d1bd80b595777e47f810b67d86b8766
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