Skip to content

Commit

Permalink
powerpc/mm/book(e)(3s)/32: Add page table accounting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Balbir Singh authored and Michael Ellerman committed Jun 5, 2017
1 parent de3b876 commit abd667b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arch/powerpc/include/asm/nohash/32/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/mm/pgtable_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit abd667b

Please sign in to comment.