diff mbox

[2/2] powerpc/mm: Enable page table accounting

Message ID 20170220021257.26959-2-bsingharora@gmail.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Balbir Singh Feb. 20, 2017, 2:12 a.m. UTC
Enabled __GFP_ACCOUNT in pgtable_get_gfp_flags(). This
allows accounting of page table allocation via kmem to
the correct cgroup. Basic testing was done to see if
the accounting reflects in

1. perf record tracing
2. memory.kmem.slabinfo

Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
 arch/powerpc/include/asm/book3s/64/pgalloc.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch/powerpc/include/asm/book3s/64/pgalloc.h b/arch/powerpc/include/asm/book3s/64/pgalloc.h
index d0a9ca6..9207213 100644
--- a/arch/powerpc/include/asm/book3s/64/pgalloc.h
+++ b/arch/powerpc/include/asm/book3s/64/pgalloc.h
@@ -52,7 +52,9 @@  extern void __tlb_remove_table(void *_table);
 
 static inline gfp_t pgtable_get_gfp_flags(struct mm_struct *mm, gfp_t gfp)
 {
-	return gfp;
+	if (mm == &init_mm)
+		return gfp;
+	return gfp | __GFP_ACCOUNT;
 }
 
 static inline pgd_t *radix__pgd_alloc(struct mm_struct *mm)