Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pagemap: export KPF_THP

This flag shows that a given page is a subpage of a transparent hugepage.
It helps us debug and test the kernel by showing physical address of thp.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Naoya Horiguchi and committed by
Linus Torvalds
e873c49f 025c5b24

+3
+2
fs/proc/page.c
··· 115 115 u |= 1 << KPF_COMPOUND_TAIL; 116 116 if (PageHuge(page)) 117 117 u |= 1 << KPF_HUGE; 118 + else if (PageTransCompound(page)) 119 + u |= 1 << KPF_THP; 118 120 119 121 /* 120 122 * Caveats on high order pages: page->_count will only be set
+1
include/linux/kernel-page-flags.h
··· 30 30 #define KPF_NOPAGE 20 31 31 32 32 #define KPF_KSM 21 33 + #define KPF_THP 22 33 34 34 35 /* kernel hacking assistances 35 36 * WARNING: subject to change, never rely on them!