* [PATCH net-next] net: remove sk_init() helper
@ 2012-09-25 21:32 Eric Dumazet
2012-09-26 2:07 ` Shan Wei
2012-09-27 22:42 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2012-09-25 21:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
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>
---
include/net/sock.h | 2 --
net/core/sock.c | 13 -------------
net/socket.c | 6 ------
3 files changed, 21 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 42053759..02456b6 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -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;
diff --git a/net/core/sock.c b/net/core/sock.c
index 727114c..f5a4260 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -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.
*/
diff --git a/net/socket.c b/net/socket.c
index c641549..80dc7e8 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2601,12 +2601,6 @@ static int __init sock_init(void)
goto out;
/*
- * Initialize sock SLAB cache.
- */
-
- sk_init();
-
- /*
* Initialize skbuff SLAB cache
*/
skb_init();
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: remove sk_init() helper
2012-09-25 21:32 [PATCH net-next] net: remove sk_init() helper Eric Dumazet
@ 2012-09-26 2:07 ` Shan Wei
2012-09-26 2:23 ` Eric Dumazet
2012-09-27 22:42 ` David Miller
1 sibling, 1 reply; 5+ messages in thread
From: Shan Wei @ 2012-09-26 2:07 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
Eric Dumazet said, at 2012/9/26 5:32:
> From: Eric Dumazet <edumazet@google.com>
>
> 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.
Ye, I have reported this problem.
http://lists.openwall.net/netdev/2012/04/27/49
How about for small RAM ~16M?
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> include/net/sock.h | 2 --
> net/core/sock.c | 13 -------------
> net/socket.c | 6 ------
> 3 files changed, 21 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 42053759..02456b6 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -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;
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 727114c..f5a4260 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -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.
> */
> diff --git a/net/socket.c b/net/socket.c
> index c641549..80dc7e8 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -2601,12 +2601,6 @@ static int __init sock_init(void)
> goto out;
>
> /*
> - * Initialize sock SLAB cache.
> - */
> -
> - sk_init();
> -
> - /*
> * Initialize skbuff SLAB cache
> */
> skb_init();
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: remove sk_init() helper
2012-09-26 2:07 ` Shan Wei
@ 2012-09-26 2:23 ` Eric Dumazet
2012-09-26 3:51 ` Shan Wei
0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2012-09-26 2:23 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, netdev
On Wed, 2012-09-26 at 10:07 +0800, Shan Wei wrote:
> Eric Dumazet said, at 2012/9/26 5:32:
> > From: Eric Dumazet <edumazet@google.com>
> >
> > 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.
>
> Ye, I have reported this problem.
> http://lists.openwall.net/netdev/2012/04/27/49
>
> How about for small RAM ~16M?
It was maybe a concern 20 years ago, ( I ran linux on [34]86 computers
with 12 or 16 MB of memory) but this makes no sense today with linux-3.7
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: remove sk_init() helper
2012-09-26 2:23 ` Eric Dumazet
@ 2012-09-26 3:51 ` Shan Wei
0 siblings, 0 replies; 5+ messages in thread
From: Shan Wei @ 2012-09-26 3:51 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
Eric Dumazet said, at 2012/9/26 10:23:
> On Wed, 2012-09-26 at 10:07 +0800, Shan Wei wrote:
>> Eric Dumazet said, at 2012/9/26 5:32:
>>> From: Eric Dumazet <edumazet@google.com>
>>>
>>> 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.
>>
>> Ye, I have reported this problem.
>> http://lists.openwall.net/netdev/2012/04/27/49
>>
>> How about for small RAM ~16M?
>
> It was maybe a concern 20 years ago, ( I ran linux on [34]86 computers
> with 12 or 16 MB of memory) but this makes no sense today with linux-3.7
I never play so lower memory computer. :-(
And now so lower memory device die out.
Reviewed-by: Shan Wei <davidshan@tencent.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: remove sk_init() helper
2012-09-25 21:32 [PATCH net-next] net: remove sk_init() helper Eric Dumazet
2012-09-26 2:07 ` Shan Wei
@ 2012-09-27 22:42 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2012-09-27 22:42 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 25 Sep 2012 23:32:13 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> 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>
Applied, thanks Eric.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-09-27 22:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25 21:32 [PATCH net-next] net: remove sk_init() helper Eric Dumazet
2012-09-26 2:07 ` Shan Wei
2012-09-26 2:23 ` Eric Dumazet
2012-09-26 3:51 ` Shan Wei
2012-09-27 22:42 ` 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).