mm: replace various uses of num_physpages by totalram_pages
commit236638ad883fec47a3db42d823a80483733143a5
authorJan Beulich <JBeulich@novell.com>
Tue, 22 Sep 2009 00:03:05 +0000 (21 17:03 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:55:50 +0000 (1 15:55 -0700)
tree4e2f0dee31320425a0692c6ae0bc9138baab04e4
parent1c5b7aee1288404afff343354e7b4ff32f3fb5f0
mm: replace various uses of num_physpages by totalram_pages

commit 4481374ce88ba8f460c8b89f2572027bd27057d0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21 files changed:
arch/x86/kernel/microcode_core.c
drivers/char/agp/backend.c
drivers/parisc/ccio-dma.c
drivers/parisc/sba_iommu.c
drivers/xen/balloon.c
fs/ntfs/malloc.h
include/linux/mm.h
init/main.c
mm/slab.c
mm/swap.c
mm/vmalloc.c
net/core/sock.c
net/dccp/proto.c
net/decnet/dn_route.c
net/ipv4/route.c
net/ipv4/tcp.c
net/netfilter/nf_conntrack_core.c
net/netfilter/x_tables.c
net/netfilter/xt_hashlimit.c
net/netlink/af_netlink.c
net/sctp/protocol.c