lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 2 Apr 2021 14:52:49 +0200 From: Eric Dumazet <edumazet@...gle.com> To: Xuan Zhuo <xuanzhuo@...ux.alibaba.com> Cc: Eric Dumazet <eric.dumazet@...il.com>, netdev <netdev@...r.kernel.org>, Alexander Duyck <alexanderduyck@...com>, Paolo Abeni <pabeni@...hat.com>, Greg Thelen <gthelen@...gle.com>, "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, su-lifan@...ux.alibaba.com, "dust.li" <dust.li@...ux.alibaba.com>, Jason Wang <jasowang@...hat.com>, "Michael S. Tsirkin" <mst@...hat.com> Subject: Re: [PATCH net] net: avoid 32 x truesize under-estimation for tiny skbs On Fri, Apr 2, 2021 at 12:35 PM Xuan Zhuo <xuanzhuo@...ux.alibaba.com> wrote: > > > Great!! > > test cmd: > sockperf tp --tcp --ip <ip> -m 8192 -t 300 > > server softirq cpu | server sockperf cpu | rxpck/s | rxkB/s > page_frag_alloc 100%. 86.1% 2211785 3270145 > kmalloc 100%. 100% 2226950 3292571 > copy ETH 100% 69.3% 2140552 3163408 > > Compared with page_frag_alloc, the performance has also increased by 19.4%. The > reason for such a big improvement I think is that although merge is turned on in > my test environment, there is only one buffer for each packet received. > > So in the page_frag_alloc scenario, when performing gro merge, one skb will > occupy two frags, one is used to store the data in the linear space, and the > other is a frag in the skb frags. Now, the linear space only has the header, so > one skb only occupies one frag space. > > In the case of using page_frag_alloc, an skb can only contain the original 8 > packets. Now a skb merges the original 17 packets Exactly. Never put payload in skb->head, unless you are sure that : 1) All payload can be put there. (or it is filling a full page, followed by remaining payload in further frags for big MTU) 2) skb->head is backed by a page fraf as well (skb->head_frag == 1) > > It's really exciting. > > I fixed the retval check of pskb_may_pull and added a pskb_may_pull call. > Here is the patch I used for testing. > > Thanks very much. Excellent, I am going to submit this patch officially, since it is not risky for stable kernels. I will give you credits as Reporter, and co-developer. Thanks for your help !
Powered by blists - more mailing lists