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 /drivers/parisc | |
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 'drivers/parisc')
-rw-r--r-- | drivers/parisc/ccio-dma.c | 4 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index a45b0c0d574e..a6b4a5a53d40 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
@@ -1266,7 +1266,7 @@ ccio_ioc_init(struct ioc *ioc) | |||
1266 | ** Hot-Plug/Removal of PCI cards. (aka PCI OLARD). | 1266 | ** Hot-Plug/Removal of PCI cards. (aka PCI OLARD). |
1267 | */ | 1267 | */ |
1268 | 1268 | ||
1269 | iova_space_size = (u32) (num_physpages / count_parisc_driver(&ccio_driver)); | 1269 | iova_space_size = (u32) (totalram_pages / count_parisc_driver(&ccio_driver)); |
1270 | 1270 | ||
1271 | /* limit IOVA space size to 1MB-1GB */ | 1271 | /* limit IOVA space size to 1MB-1GB */ |
1272 | 1272 | ||
@@ -1305,7 +1305,7 @@ ccio_ioc_init(struct ioc *ioc) | |||
1305 | 1305 | ||
1306 | DBG_INIT("%s() hpa 0x%p mem %luMB IOV %dMB (%d bits)\n", | 1306 | DBG_INIT("%s() hpa 0x%p mem %luMB IOV %dMB (%d bits)\n", |
1307 | __func__, ioc->ioc_regs, | 1307 | __func__, ioc->ioc_regs, |
1308 | (unsigned long) num_physpages >> (20 - PAGE_SHIFT), | 1308 | (unsigned long) totalram_pages >> (20 - PAGE_SHIFT), |
1309 | iova_space_size>>20, | 1309 | iova_space_size>>20, |
1310 | iov_order + PAGE_SHIFT); | 1310 | iov_order + PAGE_SHIFT); |
1311 | 1311 | ||
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 123d8fe3427d..57a6d19eba4c 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -1390,7 +1390,7 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | |||
1390 | ** for DMA hints - ergo only 30 bits max. | 1390 | ** for DMA hints - ergo only 30 bits max. |
1391 | */ | 1391 | */ |
1392 | 1392 | ||
1393 | iova_space_size = (u32) (num_physpages/global_ioc_cnt); | 1393 | iova_space_size = (u32) (totalram_pages/global_ioc_cnt); |
1394 | 1394 | ||
1395 | /* limit IOVA space size to 1MB-1GB */ | 1395 | /* limit IOVA space size to 1MB-1GB */ |
1396 | if (iova_space_size < (1 << (20 - PAGE_SHIFT))) { | 1396 | if (iova_space_size < (1 << (20 - PAGE_SHIFT))) { |
@@ -1415,7 +1415,7 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num) | |||
1415 | DBG_INIT("%s() hpa 0x%lx mem %ldMB IOV %dMB (%d bits)\n", | 1415 | DBG_INIT("%s() hpa 0x%lx mem %ldMB IOV %dMB (%d bits)\n", |
1416 | __func__, | 1416 | __func__, |
1417 | ioc->ioc_hpa, | 1417 | ioc->ioc_hpa, |
1418 | (unsigned long) num_physpages >> (20 - PAGE_SHIFT), | 1418 | (unsigned long) totalram_pages >> (20 - PAGE_SHIFT), |
1419 | iova_space_size>>20, | 1419 | iova_space_size>>20, |
1420 | iov_order + PAGE_SHIFT); | 1420 | iov_order + PAGE_SHIFT); |
1421 | 1421 | ||