]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
[TCP]: Don't set SKB owner in tcp_transmit_skb().
authorDavid S. Miller <davem@sunset.davemloft.net>
Fri, 10 Nov 2006 03:58:25 +0000 (19:58 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 3 Dec 2006 05:21:52 +0000 (21:21 -0800)
The data itself is already charged to the SKB, doing
the skb_set_owner_w() just generates a lot of noise and
extra atomics we don't really need.

Lmbench improvements on lat_tcp are minimal:

before:
TCP latency using localhost: 23.2701 microseconds
TCP latency using localhost: 23.1994 microseconds
TCP latency using localhost: 23.2257 microseconds

after:
TCP latency using localhost: 22.8380 microseconds
TCP latency using localhost: 22.9465 microseconds
TCP latency using localhost: 22.8462 microseconds

Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet6_connection_sock.h
include/net/inet_connection_sock.h
include/net/ip.h
net/dccp/output.c
net/ipv4/ip_output.c
net/ipv4/tcp_output.c
net/ipv6/inet6_connection_sock.c
net/sctp/protocol.c

index f13ddc2543b1fcb07a10aee710a7e43b0f894d17..16aa96a6a53bb02399fda07f1e8afc6ecb08913d 100644 (file)
@@ -38,5 +38,5 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk,
 
 extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr);
 
-extern int inet6_csk_xmit(struct sk_buff *skb, int ipfragok);
+extern int inet6_csk_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok);
 #endif /* _INET6_CONNECTION_SOCK_H */
index 0bcf9f237e1f0de8fc44bac445c290a9078e041a..fd3f1d8cdc4a94f5558744b583079c34a5e258e2 100644 (file)
@@ -36,7 +36,8 @@ struct tcp_congestion_ops;
  * (i.e. things that depend on the address family)
  */
 struct inet_connection_sock_af_ops {
-       int         (*queue_xmit)(struct sk_buff *skb, int ipfragok);
+       int         (*queue_xmit)(struct sk_buff *skb, struct sock *sk,
+                                 int ipfragok);
        void        (*send_check)(struct sock *sk, int len,
                                  struct sk_buff *skb);
        int         (*rebuild_header)(struct sock *sk);
index b6d95e5534016c3a3440525bc4ec00d196fcaeb4..949fa8683626512983f8e59d90e8a01aa2252985 100644 (file)
@@ -97,7 +97,7 @@ extern int            ip_mc_output(struct sk_buff *skb);
 extern int             ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
 extern int             ip_do_nat(struct sk_buff *skb);
 extern void            ip_send_check(struct iphdr *ip);
-extern int             ip_queue_xmit(struct sk_buff *skb, int ipfragok);
+extern int             ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok);
 extern void            ip_init(void);
 extern int             ip_append_data(struct sock *sk,
                                       int getfrag(void *from, char *to, int offset, int len,
index 7102e3aed4ca2885928e990cf8b934e87d6fe2e4..2cc4f4b2a9dd3027f5a776e58f8e56f579be6de1 100644 (file)
@@ -125,7 +125,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
                DCCP_INC_STATS(DCCP_MIB_OUTSEGS);
 
                memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-               err = icsk->icsk_af_ops->queue_xmit(skb, 0);
+               err = icsk->icsk_af_ops->queue_xmit(skb, sk, 0);
                if (err <= 0)
                        return err;
 
@@ -426,7 +426,7 @@ int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code)
                                                      code);
                if (skb != NULL) {
                        memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-                       err = inet_csk(sk)->icsk_af_ops->queue_xmit(skb, 0);
+                       err = inet_csk(sk)->icsk_af_ops->queue_xmit(skb, sk, 0);
                        if (err == NET_XMIT_CN)
                                err = 0;
                }
index 23633bf042baae2374a659667defeb14c0524937..def32d8d3b067ab356cbf11999bb8768a41a728f 100644 (file)
@@ -288,9 +288,8 @@ int ip_output(struct sk_buff *skb)
                            !(IPCB(skb)->flags & IPSKB_REROUTED));
 }
 
-int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
+int ip_queue_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok)
 {
-       struct sock *sk = skb->sk;
        struct inet_sock *inet = inet_sk(sk);
        struct ip_options *opt = inet->opt;
        struct rtable *rt;
index ca406157724c5399eb6c5a0ae443cbb65f9aa3f2..f63e99aac2d5bdc5152af8a5128861e319737b3d 100644 (file)
@@ -426,7 +426,6 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
 
        th = (struct tcphdr *) skb_push(skb, tcp_header_size);
        skb->h.th = th;
-       skb_set_owner_w(skb, sk);
 
        /* Build TCP header and checksum it. */
        th->source              = inet->sport;
@@ -479,7 +478,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
        if (after(tcb->end_seq, tp->snd_nxt) || tcb->seq == tcb->end_seq)
                TCP_INC_STATS(TCP_MIB_OUTSEGS);
 
-       err = icsk->icsk_af_ops->queue_xmit(skb, 0);
+       err = icsk->icsk_af_ops->queue_xmit(skb, sk, 0);
        if (likely(err <= 0))
                return err;
 
index e48fb4c53c4f7397279194fe623b813a01afa7de..c598962eaa40480efa2b5c8eb8672cf645f1cfce 100644 (file)
@@ -139,9 +139,8 @@ void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr)
 
 EXPORT_SYMBOL_GPL(inet6_csk_addr2sockaddr);
 
-int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
+int inet6_csk_xmit(struct sk_buff *skb, struct sock *sk, int ipfragok)
 {
-       struct sock *sk = skb->sk;
        struct inet_sock *inet = inet_sk(sk);
        struct ipv6_pinfo *np = inet6_sk(sk);
        struct flowi fl;
index 5b4f82fd98f834456ae308cd4ee3426ba29409e8..c107d45f6e65e5b2eec5caf808f32d483785d171 100644 (file)
@@ -808,7 +808,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
                          NIPQUAD(((struct rtable *)skb->dst)->rt_dst));
 
        SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
-       return ip_queue_xmit(skb, ipfragok);
+       return ip_queue_xmit(skb, skb->sk, ipfragok);
 }
 
 static struct sctp_af sctp_ipv4_specific;