aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2009-09-21 20:03:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 10:17:38 -0400
commit4481374ce88ba8f460c8b89f2572027bd27057d0 (patch)
tree6896601b6a1da0e3e932ffa75fcff966c834c02c /net/netlink
parent4738e1b9cf8f9e28d7de080a5e6ce5d0095ea18f (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/netlink')
-rw-r--r--net/netlink/af_netlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c5aab6a368ce..55180b99562a 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2091,10 +2091,10 @@ static int __init netlink_proto_init(void)
2091 if (!nl_table) 2091 if (!nl_table)
2092 goto panic; 2092 goto panic;
2093 2093
2094 if (num_physpages >= (128 * 1024)) 2094 if (totalram_pages >= (128 * 1024))
2095 limit = num_physpages >> (21 - PAGE_SHIFT); 2095 limit = totalram_pages >> (21 - PAGE_SHIFT);
2096 else 2096 else
2097 limit = num_physpages >> (23 - PAGE_SHIFT); 2097 limit = totalram_pages >> (23 - PAGE_SHIFT);
2098 2098
2099 order = get_bitmask_order(limit) - 1 + PAGE_SHIFT; 2099 order = get_bitmask_order(limit) - 1 + PAGE_SHIFT;
2100 limit = (1UL << order) / sizeof(struct hlist_head); 2100 limit = (1UL << order) / sizeof(struct hlist_head);