diff options
| author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-09 18:24:26 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-11-10 15:12:00 -0500 |
| commit | 8d987e5c75107ca7515fa19e857cfa24aab6ec8f (patch) | |
| tree | 6392c5f08f0df39d42a079336f6be3960ac404dc /net/sctp | |
| parent | 67286640f638f5ad41a946b9a3dc75327950248f (diff) | |
net: avoid limits overflow
Robin Holt tried to boot a 16TB machine and found some limits were
reached : sysctl_tcp_mem[2], sysctl_udp_mem[2]
We can switch infrastructure to use long "instead" of "int", now
atomic_long_t primitives are available for free.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: Robin Holt <holt@sgi.com>
Reviewed-by: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
| -rw-r--r-- | net/sctp/protocol.c | 2 | ||||
| -rw-r--r-- | net/sctp/socket.c | 4 | ||||
| -rw-r--r-- | net/sctp/sysctl.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 1ef29c74d85e..e58f9476f29c 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
| @@ -92,7 +92,7 @@ static struct sctp_af *sctp_af_v6_specific; | |||
| 92 | struct kmem_cache *sctp_chunk_cachep __read_mostly; | 92 | struct kmem_cache *sctp_chunk_cachep __read_mostly; |
| 93 | struct kmem_cache *sctp_bucket_cachep __read_mostly; | 93 | struct kmem_cache *sctp_bucket_cachep __read_mostly; |
| 94 | 94 | ||
| 95 | int sysctl_sctp_mem[3]; | 95 | long sysctl_sctp_mem[3]; |
| 96 | int sysctl_sctp_rmem[3]; | 96 | int sysctl_sctp_rmem[3]; |
| 97 | int sysctl_sctp_wmem[3]; | 97 | int sysctl_sctp_wmem[3]; |
| 98 | 98 | ||
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index e34ca9cc1167..6bd554323a34 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -111,12 +111,12 @@ static void sctp_sock_migrate(struct sock *, struct sock *, | |||
| 111 | static char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG; | 111 | static char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG; |
| 112 | 112 | ||
| 113 | extern struct kmem_cache *sctp_bucket_cachep; | 113 | extern struct kmem_cache *sctp_bucket_cachep; |
| 114 | extern int sysctl_sctp_mem[3]; | 114 | extern long sysctl_sctp_mem[3]; |
| 115 | extern int sysctl_sctp_rmem[3]; | 115 | extern int sysctl_sctp_rmem[3]; |
| 116 | extern int sysctl_sctp_wmem[3]; | 116 | extern int sysctl_sctp_wmem[3]; |
| 117 | 117 | ||
| 118 | static int sctp_memory_pressure; | 118 | static int sctp_memory_pressure; |
| 119 | static atomic_t sctp_memory_allocated; | 119 | static atomic_long_t sctp_memory_allocated; |
| 120 | struct percpu_counter sctp_sockets_allocated; | 120 | struct percpu_counter sctp_sockets_allocated; |
| 121 | 121 | ||
| 122 | static void sctp_enter_memory_pressure(struct sock *sk) | 122 | static void sctp_enter_memory_pressure(struct sock *sk) |
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 832590bbe0c0..50cb57f0919e 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c | |||
| @@ -54,7 +54,7 @@ static int sack_timer_max = 500; | |||
| 54 | static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ | 54 | static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ |
| 55 | static int rwnd_scale_max = 16; | 55 | static int rwnd_scale_max = 16; |
| 56 | 56 | ||
| 57 | extern int sysctl_sctp_mem[3]; | 57 | extern long sysctl_sctp_mem[3]; |
| 58 | extern int sysctl_sctp_rmem[3]; | 58 | extern int sysctl_sctp_rmem[3]; |
| 59 | extern int sysctl_sctp_wmem[3]; | 59 | extern int sysctl_sctp_wmem[3]; |
| 60 | 60 | ||
| @@ -203,7 +203,7 @@ static ctl_table sctp_table[] = { | |||
| 203 | .data = &sysctl_sctp_mem, | 203 | .data = &sysctl_sctp_mem, |
| 204 | .maxlen = sizeof(sysctl_sctp_mem), | 204 | .maxlen = sizeof(sysctl_sctp_mem), |
| 205 | .mode = 0644, | 205 | .mode = 0644, |
| 206 | .proc_handler = proc_dointvec, | 206 | .proc_handler = proc_doulongvec_minmax |
| 207 | }, | 207 | }, |
| 208 | { | 208 | { |
| 209 | .procname = "sctp_rmem", | 209 | .procname = "sctp_rmem", |
