diff options
Diffstat (limited to 'fs/proc/page.c')
-rw-r--r-- | fs/proc/page.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/proc/page.c b/fs/proc/page.c index b8730d9ebaee..e647c55275d9 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c | |||
@@ -118,10 +118,11 @@ u64 stable_page_flags(struct page *page) | |||
118 | /* | 118 | /* |
119 | * PageTransCompound can be true for non-huge compound pages (slab | 119 | * PageTransCompound can be true for non-huge compound pages (slab |
120 | * pages or pages allocated by drivers with __GFP_COMP) because it | 120 | * pages or pages allocated by drivers with __GFP_COMP) because it |
121 | * just checks PG_head/PG_tail, so we need to check PageLRU to make | 121 | * just checks PG_head/PG_tail, so we need to check PageLRU/PageAnon |
122 | * sure a given page is a thp, not a non-huge compound page. | 122 | * to make sure a given page is a thp, not a non-huge compound page. |
123 | */ | 123 | */ |
124 | else if (PageTransCompound(page) && PageLRU(compound_trans_head(page))) | 124 | else if (PageTransCompound(page) && (PageLRU(compound_head(page)) || |
125 | PageAnon(compound_head(page)))) | ||
125 | u |= 1 << KPF_THP; | 126 | u |= 1 << KPF_THP; |
126 | 127 | ||
127 | /* | 128 | /* |
@@ -217,4 +218,4 @@ static int __init proc_page_init(void) | |||
217 | proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations); | 218 | proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations); |
218 | return 0; | 219 | return 0; |
219 | } | 220 | } |
220 | module_init(proc_page_init); | 221 | fs_initcall(proc_page_init); |