|
@@ -6,7 +6,7 @@
|
|
#include <asm/fixmap.h>
|
|
#include <asm/fixmap.h>
|
|
#include <asm/mtrr.h>
|
|
#include <asm/mtrr.h>
|
|
|
|
|
|
-#define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO
|
|
|
|
|
|
+#define PGALLOC_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK | __GFP_ZERO)
|
|
|
|
|
|
#ifdef CONFIG_HIGHPTE
|
|
#ifdef CONFIG_HIGHPTE
|
|
#define PGALLOC_USER_GFP __GFP_HIGHMEM
|
|
#define PGALLOC_USER_GFP __GFP_HIGHMEM
|
|
@@ -18,7 +18,7 @@ gfp_t __userpte_alloc_gfp = PGALLOC_GFP | PGALLOC_USER_GFP;
|
|
|
|
|
|
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
|
|
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
|
|
{
|
|
{
|
|
- return (pte_t *)__get_free_page(PGALLOC_GFP);
|
|
|
|
|
|
+ return (pte_t *)__get_free_page(PGALLOC_GFP & ~__GFP_ACCOUNT);
|
|
}
|
|
}
|
|
|
|
|
|
pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
|
pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
|
@@ -207,9 +207,13 @@ static int preallocate_pmds(struct mm_struct *mm, pmd_t *pmds[])
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
bool failed = false;
|
|
bool failed = false;
|
|
|
|
+ gfp_t gfp = PGALLOC_GFP;
|
|
|
|
+
|
|
|
|
+ if (mm == &init_mm)
|
|
|
|
+ gfp &= ~__GFP_ACCOUNT;
|
|
|
|
|
|
for(i = 0; i < PREALLOCATED_PMDS; i++) {
|
|
for(i = 0; i < PREALLOCATED_PMDS; i++) {
|
|
- pmd_t *pmd = (pmd_t *)__get_free_page(PGALLOC_GFP);
|
|
|
|
|
|
+ pmd_t *pmd = (pmd_t *)__get_free_page(gfp);
|
|
if (!pmd)
|
|
if (!pmd)
|
|
failed = true;
|
|
failed = true;
|
|
if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
|
|
if (pmd && !pgtable_pmd_page_ctor(virt_to_page(pmd))) {
|