* [PATCH net-next] tcp: tcp_make_synack() can use alloc_skb()
@ 2012-06-04 5:50 Eric Dumazet
2012-06-04 15:33 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2012-06-04 5:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
There is no value using sock_wmalloc() in tcp_make_synack().
A listener socket only sends SYNACK packets, they are not queued in a
socket queue, only in Qdisc and device layers, so the number of in
flight packets is limited in these layers. We used sock_wmalloc() with
the %force parameter set to 1 to ignore socket limits anyway.
This patch removes two atomic operations per SYNACK packet.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/ipv4/tcp_output.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 803cbfe..f0b0e44 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2461,7 +2461,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired)
s_data_desired = cvp->s_data_desired;
- skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);
+ skb = alloc_skb(MAX_TCP_HEADER + 15 + s_data_desired, GFP_ATOMIC);
if (skb == NULL)
return NULL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] tcp: tcp_make_synack() can use alloc_skb()
2012-06-04 5:50 [PATCH net-next] tcp: tcp_make_synack() can use alloc_skb() Eric Dumazet
@ 2012-06-04 15:33 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-06-04 15:33 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 04 Jun 2012 07:50:43 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> There is no value using sock_wmalloc() in tcp_make_synack().
>
> A listener socket only sends SYNACK packets, they are not queued in a
> socket queue, only in Qdisc and device layers, so the number of in
> flight packets is limited in these layers. We used sock_wmalloc() with
> the %force parameter set to 1 to ignore socket limits anyway.
>
> This patch removes two atomic operations per SYNACK packet.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Looks good, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-04 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-04 5:50 [PATCH net-next] tcp: tcp_make_synack() can use alloc_skb() Eric Dumazet
2012-06-04 15:33 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).