Skip to content

Commit

Permalink
tcp: use page_ref_inc() in tcp_sendmsg()
Browse files Browse the repository at this point in the history
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: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 17, 2017
1 parent a4ecb15 commit 4e33e34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4e33e34

Please sign in to comment.