Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f561d0f27d6283c49359bb96048f8ac3728c812c
Commit:     f561d0f27d6283c49359bb96048f8ac3728c812c
Parent:     3015a347dcd470fcc8becf1f84b0502391a3c0e0
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 29 20:28:50 2007 +1100
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:55:07 2008 -0800

    [NET]: Uninline the sk_stream_alloc_pskb
    
    This function seems too big for inlining. Indeed, it saves
    half-a-kilo when uninlined:
    
    add/remove: 1/0 grow/shrink: 0/7 up/down: 195/-719 (-524)
    function                                     old     new   delta
    sk_stream_alloc_pskb                           -     195    +195
    ip_rt_init                                   529     525      -4
    __inet_lookup_listener                       284     274     -10
    tcp_sendmsg                                 2583    2486     -97
    tcp_sendpage                                1449    1305    -144
    tso_fragment                                 417     267    -150
    tcp_fragment                                1149     992    -157
    __tcp_push_pending_frames                   1998    1841    -157
    
    Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/sock.h |   29 ++---------------------------
 net/ipv4/tcp.c     |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index e329d05..7d500a8 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1192,33 +1192,8 @@ static inline void sk_stream_moderate_sndbuf(struct sock 
*sk)
        }
 }
 
-static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
-                                                  int size, int mem,
-                                                  gfp_t gfp)
-{
-       struct sk_buff *skb;
-
-       /* The TCP header must be at least 32-bit aligned.  */
-       size = ALIGN(size, 4);
-
-       skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
-       if (skb) {
-               skb->truesize += mem;
-               if (sk_stream_wmem_schedule(sk, skb->truesize)) {
-                       /*
-                        * Make sure that we have exactly size bytes
-                        * available to the caller, no more, no less.
-                        */
-                       skb_reserve(skb, skb_tailroom(skb) - size);
-                       return skb;
-               }
-               __kfree_skb(skb);
-       } else {
-               sk->sk_prot->enter_memory_pressure();
-               sk_stream_moderate_sndbuf(sk);
-       }
-       return NULL;
-}
+struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
+               int size, int mem, gfp_t gfp);
 
 static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk,
                                                  int size,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index e055f25..6b35ab8 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -629,6 +629,33 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
        return ret;
 }
 
+struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
+               int size, int mem, gfp_t gfp)
+{
+       struct sk_buff *skb;
+
+       /* The TCP header must be at least 32-bit aligned.  */
+       size = ALIGN(size, 4);
+
+       skb = alloc_skb_fclone(size + sk->sk_prot->max_header, gfp);
+       if (skb) {
+               skb->truesize += mem;
+               if (sk_stream_wmem_schedule(sk, skb->truesize)) {
+                       /*
+                        * Make sure that we have exactly size bytes
+                        * available to the caller, no more, no less.
+                        */
+                       skb_reserve(skb, skb_tailroom(skb) - size);
+                       return skb;
+               }
+               __kfree_skb(skb);
+       } else {
+               sk->sk_prot->enter_memory_pressure();
+               sk_stream_moderate_sndbuf(sk);
+       }
+       return NULL;
+}
+
 static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int 
poffset,
                         size_t psize, int flags)
 {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to