Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e33e346 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: use page_ref_inc() in tcp_sendmsg()



sk_page_frag_refill() allocates either a compound page or an order-0
page. We can use page_ref_inc() which is slightly faster than get_page()

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a4ecb15a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1288,7 +1288,7 @@ int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
			} else {
				skb_fill_page_desc(skb, i, pfrag->page,
						   pfrag->offset, copy);
				get_page(pfrag->page);
				page_ref_inc(pfrag->page);
			}
			pfrag->offset += copy;
		}