powerpc/mm/book(e)(3s)/32: Add page table accounting
authorBalbir Singh <bsingharora@gmail.com>
Tue, 2 May 2017 05:17:05 +0000 (15:17 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 5 Jun 2017 09:03:11 +0000 (19:03 +1000)
Add support in pte_alloc_one() and pgd_alloc() by
passing __GFP_ACCOUNT in the flags

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/nohash/32/pgalloc.h
arch/powerpc/mm/pgtable_32.c

index 633139291a481a3986fda12c372d2990632a8620..cc369a70f2bb3f6c03eaf4d8ae92f6aac3eb6ba5 100644 (file)
@@ -31,7 +31,8 @@ extern struct kmem_cache *pgtable_cache[];
 
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-       return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), GFP_KERNEL);
+       return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE),
+                       pgtable_gfp_flags(mm, GFP_KERNEL));
 }
 
 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
index cf32c5c6fe28956905f9f3e2a9e5469150d83c12..8de9db2b4d96a1a476569115eb645d747727d849 100644 (file)
@@ -60,7 +60,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
        struct page *ptepage;
 
-       gfp_t flags = GFP_KERNEL | __GFP_ZERO;
+       gfp_t flags = GFP_KERNEL | __GFP_ZERO | __GFP_ACCOUNT;
 
        ptepage = alloc_pages(flags, 0);
        if (!ptepage)