aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/include/asm/pgalloc.h
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2015-03-18 13:42:38 -0400
committerHelge Deller <deller@gmx.de>2015-03-23 07:28:15 -0400
commit0e0da48dee8dfbcc0df4b8e2ff4efc7a2c89ba6b (patch)
tree3a648fc0931decd74a2bbb3daae418e5ddc96d5c /arch/parisc/include/asm/pgalloc.h
parent47514da3ac20150cdf764466fbc2010c0fca0163 (diff)
parisc: mm: don't count preallocated pmds
The patch dc6c9a35b66b520cf67e05d8ca60ebecad3b0479 that counts pmds allocated for a process introduced a bug on 64-bit PA-RISC kernels. The PA-RISC architecture preallocates one pmd with each pgd. This preallocated pmd can never be freed - pmd_free does nothing when it is called with this pmd. When the kernel attempts to free this preallocated pmd, it decreases the count of allocated pmds. The result is that the counter underflows and this error is reported. This patch fixes the bug by artifically incrementing the counter in pmd_free when the kernel tries to free the preallocated pmd. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/include/asm/pgalloc.h')
-rw-r--r--arch/parisc/include/asm/pgalloc.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/parisc/include/asm/pgalloc.h b/arch/parisc/include/asm/pgalloc.h
index f213f5b4c423..63e9ecae1310 100644
--- a/arch/parisc/include/asm/pgalloc.h
+++ b/arch/parisc/include/asm/pgalloc.h
@@ -74,8 +74,13 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
74{ 74{
75#ifdef CONFIG_64BIT 75#ifdef CONFIG_64BIT
76 if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) 76 if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
77 /* This is the permanent pmd attached to the pgd; 77 /*
78 * cannot free it */ 78 * This is the permanent pmd attached to the pgd;
79 * cannot free it.
80 * Increment the counter to compensate for the decrement
81 * done by generic mm code.
82 */
83 mm_inc_nr_pmds(mm);
79 return; 84 return;
80#endif 85#endif
81 free_pages((unsigned long)pmd, PMD_ORDER); 86 free_pages((unsigned long)pmd, PMD_ORDER);