kernel_optimize_test/net
Eric Dumazet d7cc399e12 tcp: properly reset skb->truesize for tx recycling
tcp sendmsg() and sendpage() normally advance skb->data_len
and skb->truesize by the payload added to an skb.

But sendmsg(fd, ..., MSG_ZEROCOPY) has to account for whole pages,
even if a single byte of payload is used in the page.

This means that we can not assume skb->truesize can be adjusted
by skb->data_len. We must instead overwrite its value.

Otherwise skb->truesize is too big and can hit socket sndbuf limit,
especially if the skb is recycled multiple times :/

Fixes: 472c2e07ee ("tcp: add one skb cache for tx")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-19 16:42:33 -07:00
..
6lowpan
9p 9p/net: fix memory leak in p9_client_create 2019-03-13 11:50:04 +01:00
802
8021q vlan: do not transfer link state in vlan bridge binding mode 2019-04-19 13:58:17 -07:00
appletalk net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
atm net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
ax25 net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
batman-adv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-05 14:14:19 -07:00
bluetooth net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
bpf bpf: explicitly prohibit ctx_{in, out} in non-skb BPF_PROG_TEST_RUN 2019-04-12 00:53:00 +02:00
bpfilter bpfilter: re-add header search paths to tools include to fix build error 2019-02-23 13:34:40 -08:00
bridge bridge: update vlan dev link state for bridge netdev changes 2019-04-19 13:58:17 -07:00
caif net: caif: avoid using qdisc_qlen() 2019-04-10 12:20:46 -07:00
can net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
ceph libceph: fix breakage caused by multipage bvecs 2019-03-25 22:28:07 +01:00
core net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
dcb
dccp net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
decnet net: use rcu_dereference_protected to fetch sk_dst_cache in sk_destruct 2019-04-01 18:10:51 -07:00
dns_resolver dns: remove redundant zero length namelen check 2019-04-11 14:01:08 -07:00
dsa Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-05 14:14:19 -07:00
ethernet net/ethernet: Add parse_protocol header_ops support 2019-02-22 12:55:31 -08:00
hsr net: hsr: add tx stats for master interface 2019-04-15 17:22:02 -07:00
ieee802154 net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
ife
ipv4 tcp: properly reset skb->truesize for tx recycling 2019-04-19 16:42:33 -07:00
ipv6 net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
iucv
kcm kcm: switch order of device registration to fix a crash 2019-04-01 14:59:20 -07:00
key af_key: unconditionally clone on broadcast 2019-02-12 10:36:42 +01:00
l2tp net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
l3mdev
lapb
llc llc: Check address length before reading address field 2019-04-12 10:25:03 -07:00
mac80211 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
mac802154
mpls ipv4: Add support to rtable for ipv6 gateway 2019-04-08 15:22:40 -07:00
ncsi genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
netfilter bridge: netfilter: unroll NF_HOOK helper in bridge input path 2019-04-12 01:47:39 +02:00
netlabel genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
netlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
netrom net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-08 23:39:36 -07:00
nsh
openvswitch netfilter: replace NF_NAT_NEEDED with IS_ENABLED(CONFIG_NF_NAT) 2019-04-08 23:02:52 +02:00
packet net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
phonet phonet: fix building with clang 2019-02-21 16:23:56 -08:00
psample
qrtr net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
rds net/rds: Check address length before reading address family 2019-04-12 10:25:03 -07:00
rfkill
rose net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
rxrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
sched net/sched: taprio: fix build without 64bit div 2019-04-18 17:06:15 -07:00
sctp net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
smc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
strparser Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
sunrpc Revert "SUNRPC: Micro-optimise when the task is known not to be sleeping" 2019-04-11 15:41:14 -04:00
switchdev switchdev: Remove unused transaction item queue 2019-03-01 21:35:19 -08:00
tipc tipc: introduce new socket option TIPC_SOCK_RECVQ_USED 2019-04-19 14:59:05 -07:00
tls Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
unix datagram: remove rendundant 'peeked' argument 2019-04-08 09:51:54 -07:00
vmw_vsock vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock 2019-03-08 15:15:44 -08:00
wimax genetlink: make policy common to family 2019-03-22 10:38:23 -04:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-04-17 11:26:25 -07:00
x25 net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
xdp xsk: fix umem memory leak on cleanup 2019-03-16 01:27:51 +01:00
xfrm net: dev: rename queue selection helpers. 2019-03-20 11:18:54 -07:00
compat.c net: rework SIOCGSTAMP ioctl handling 2019-04-19 14:07:40 -07:00
Kconfig net: devlink: select NET_DEVLINK from drivers 2019-03-24 14:55:31 -04:00
Makefile net: split out functions related to registering inflight socket files 2019-02-28 08:24:23 -07:00
socket.c net: socket: implement 64-bit timestamps 2019-04-19 14:07:40 -07:00
sysctl_net.c