diff options
author | Jan Beulich <JBeulich@novell.com> | 2009-09-21 20:03:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:38 -0400 |
commit | 4481374ce88ba8f460c8b89f2572027bd27057d0 (patch) | |
tree | 6896601b6a1da0e3e932ffa75fcff966c834c02c /net/core | |
parent | 4738e1b9cf8f9e28d7de080a5e6ce5d0095ea18f (diff) |
mm: replace various uses of num_physpages by totalram_pages
Sizing of memory allocations shouldn't depend on the number of physical
pages found in a system, as that generally includes (perhaps a huge amount
of) non-RAM pages. The amount of what actually is usable as storage
should instead be used as a basis here.
Some of the calculations (i.e. those not intending to use high memory)
should likely even use (totalram_pages - totalhigh_pages).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 30d5446512f9..524712a7b154 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1206,12 +1206,12 @@ EXPORT_SYMBOL_GPL(sk_setup_caps); | |||
1206 | 1206 | ||
1207 | void __init sk_init(void) | 1207 | void __init sk_init(void) |
1208 | { | 1208 | { |
1209 | if (num_physpages <= 4096) { | 1209 | if (totalram_pages <= 4096) { |
1210 | sysctl_wmem_max = 32767; | 1210 | sysctl_wmem_max = 32767; |
1211 | sysctl_rmem_max = 32767; | 1211 | sysctl_rmem_max = 32767; |
1212 | sysctl_wmem_default = 32767; | 1212 | sysctl_wmem_default = 32767; |
1213 | sysctl_rmem_default = 32767; | 1213 | sysctl_rmem_default = 32767; |
1214 | } else if (num_physpages >= 131072) { | 1214 | } else if (totalram_pages >= 131072) { |
1215 | sysctl_wmem_max = 131071; | 1215 | sysctl_wmem_max = 131071; |
1216 | sysctl_rmem_max = 131071; | 1216 | sysctl_rmem_max = 131071; |
1217 | } | 1217 | } |