net: remove sk_init() helper
authorEric Dumazet <edumazet@google.com>
Tue, 25 Sep 2012 11:32:13 +0000 (11:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Sep 2012 22:42:00 +0000 (18:42 -0400)
It seems sk_init() has no value today and even does strange things :

# grep . /proc/sys/net/core/?mem_*
/proc/sys/net/core/rmem_default:212992
/proc/sys/net/core/rmem_max:131071
/proc/sys/net/core/wmem_default:212992
/proc/sys/net/core/wmem_max:131071

We can remove it completely.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Shan Wei <davidshan@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/core/sock.c
net/socket.c

index f036493b9a619cdf1b84fbc0e7caad8568058f40..bc476a19f28ef3c3dc9e0cd5ca261b5be87b4b4a 100644 (file)
@@ -2229,8 +2229,6 @@ extern int net_msg_warn;
 extern __u32 sysctl_wmem_max;
 extern __u32 sysctl_rmem_max;
 
-extern void sk_init(void);
-
 extern int sysctl_optmem_max;
 
 extern __u32 sysctl_wmem_default;
index 727114cd6f7ebdcc63e312eb89a9f3634d2308e3..f5a426097236129310e1129f4fbe65e5746352cf 100644 (file)
@@ -1464,19 +1464,6 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
 }
 EXPORT_SYMBOL_GPL(sk_setup_caps);
 
-void __init sk_init(void)
-{
-       if (totalram_pages <= 4096) {
-               sysctl_wmem_max = 32767;
-               sysctl_rmem_max = 32767;
-               sysctl_wmem_default = 32767;
-               sysctl_rmem_default = 32767;
-       } else if (totalram_pages >= 131072) {
-               sysctl_wmem_max = 131071;
-               sysctl_rmem_max = 131071;
-       }
-}
-
 /*
  *     Simple resource managers for sockets.
  */
index c641549a13e2902ecfa277fb0e41082aa0f3576e..80dc7e84b046358581f454ec87993d4195e6edc3 100644 (file)
@@ -2600,12 +2600,6 @@ static int __init sock_init(void)
        if (err)
                goto out;
 
-       /*
-        *      Initialize sock SLAB cache.
-        */
-
-       sk_init();
-
        /*
         *      Initialize skbuff SLAB cache
         */