summaryrefslogtreecommitdiff
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorKrishna Reddy <vdumpa@nvidia.com>2011-11-30 17:37:52 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-23 12:00:59 +0530
commit055a0f2b55eb22a401b9596ba84396a1f0eb02f0 (patch)
tree66a723b9e500d01a412a39e0f10a32b5e520e075 /arch/arm/mm
parent13f51a9a3f33a4ef7157abb535c312ac68e041f1 (diff)
arm: mm: Fix CPA page count stats issue.
Bug 865816 Change-Id: Iebdfdbd650cb82f25487ebee1c2b3839ed1fcf94 Signed-off-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-on: http://git-master/r/71729 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/mmu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index fd38662098cd..4fa9c246ae93 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -555,6 +555,7 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
{
pmd_t *pmd = pmd_offset(pud, addr);
unsigned long pages_2m = 0, pages_4k = 0;
+ unsigned long stash_phys = phys;
/*
* Try a section mapping - end, addr and phys must all be aligned
@@ -565,6 +566,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
if (((addr | end | phys) & ~SECTION_MASK) == 0) {
pmd_t *p = pmd;
+ pages_2m = (end - addr) >> (PGDIR_SHIFT);
+
if (addr & SECTION_SIZE)
pmd++;
@@ -573,19 +576,17 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
phys += SECTION_SIZE;
} while (pmd++, addr += SECTION_SIZE, addr != end);
- pages_2m += (end-addr) >> SECTION_SHIFT;
-
flush_pmd_entry(p);
} else {
+ pages_4k = (end - addr) >> PAGE_SHIFT;
/*
* No need to loop; pte's aren't interested in the
* individual L1 entries.
*/
alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type);
- pages_4k += (end-addr) >> PAGE_SHIFT;
}
- if ((addr < lowmem_limit) && (end < lowmem_limit)) {
+ if ((stash_phys >= PHYS_OFFSET) && (stash_phys < lowmem_limit)) {
update_page_count(PG_LEVEL_2M, pages_2m);
update_page_count(PG_LEVEL_4K, pages_4k);
}