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/sctp | |
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/sctp')
-rw-r--r-- | net/sctp/protocol.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index c557f1fb1c66..612dc878e05c 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -1184,10 +1184,10 @@ SCTP_STATIC __init int sctp_init(void) | |||
1184 | /* Size and allocate the association hash table. | 1184 | /* Size and allocate the association hash table. |
1185 | * The methodology is similar to that of the tcp hash tables. | 1185 | * The methodology is similar to that of the tcp hash tables. |
1186 | */ | 1186 | */ |
1187 | if (num_physpages >= (128 * 1024)) | 1187 | if (totalram_pages >= (128 * 1024)) |
1188 | goal = num_physpages >> (22 - PAGE_SHIFT); | 1188 | goal = totalram_pages >> (22 - PAGE_SHIFT); |
1189 | else | 1189 | else |
1190 | goal = num_physpages >> (24 - PAGE_SHIFT); | 1190 | goal = totalram_pages >> (24 - PAGE_SHIFT); |
1191 | 1191 | ||
1192 | for (order = 0; (1UL << order) < goal; order++) | 1192 | for (order = 0; (1UL << order) < goal; order++) |
1193 | ; | 1193 | ; |