* [PATCH net-next] tcp: use page_ref_inc() in tcp_sendmsg()
@ 2017-02-17 17:11 Eric Dumazet
2017-02-17 20:31 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2017-02-17 17:11 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
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>
---
net/ipv4/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index d44a6989e76d69aa44e2a26d37b4204376c94966..da385ae997a3d61f0217a2e585088a82e6d50cd3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] tcp: use page_ref_inc() in tcp_sendmsg()
2017-02-17 17:11 [PATCH net-next] tcp: use page_ref_inc() in tcp_sendmsg() Eric Dumazet
@ 2017-02-17 20:31 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-02-17 20:31 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 17 Feb 2017 09:11:42 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> 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>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-17 20:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17 17:11 [PATCH net-next] tcp: use page_ref_inc() in tcp_sendmsg() Eric Dumazet
2017-02-17 20:31 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.