File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed
Documentation/admin-guide/mm Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ Short descriptions to the page flags
118
118
21 - KSM
119
119
Identical memory pages dynamically shared between one or more processes.
120
120
22 - THP
121
- Contiguous pages which construct transparent hugepages .
121
+ Contiguous pages which construct THP of any size and mapped by any granularity .
122
122
23 - OFFLINE
123
123
The page is logically offline.
124
124
24 - ZERO_PAGE
@@ -231,7 +231,7 @@ Following flags about pages are currently supported:
231
231
- ``PAGE_IS_PRESENT `` - Page is present in the memory
232
232
- ``PAGE_IS_SWAPPED `` - Page is in swapped
233
233
- ``PAGE_IS_PFNZERO `` - Page has zero PFN
234
- - ``PAGE_IS_HUGE `` - Page is THP or Hugetlb backed
234
+ - ``PAGE_IS_HUGE `` - Page is PMD-mapped THP or Hugetlb backed
235
235
- ``PAGE_IS_SOFT_DIRTY `` - Page is soft-dirty
236
236
237
237
The ``struct pm_scan_arg `` is used as the argument of the IOCTL.
Original file line number Diff line number Diff line change @@ -147,19 +147,16 @@ u64 stable_page_flags(const struct page *page)
147
147
u |= 1 << KPF_COMPOUND_TAIL ;
148
148
if (folio_test_hugetlb (folio ))
149
149
u |= 1 << KPF_HUGE ;
150
- /*
151
- * We need to check PageLRU/PageAnon
152
- * to make sure a given page is a thp, not a non-huge compound page.
153
- */
154
- else if (folio_test_large (folio )) {
155
- if ((k & (1 << PG_lru )) || is_anon )
156
- u |= 1 << KPF_THP ;
157
- else if (is_huge_zero_folio (folio )) {
158
- u |= 1 << KPF_ZERO_PAGE ;
159
- u |= 1 << KPF_THP ;
160
- }
161
- } else if (is_zero_pfn (page_to_pfn (page )))
150
+ else if (folio_test_large (folio ) &&
151
+ folio_test_large_rmappable (folio )) {
152
+ /* Note: we indicate any THPs here, not just PMD-sized ones */
153
+ u |= 1 << KPF_THP ;
154
+ } else if (is_huge_zero_folio (folio )) {
162
155
u |= 1 << KPF_ZERO_PAGE ;
156
+ u |= 1 << KPF_THP ;
157
+ } else if (is_zero_folio (folio )) {
158
+ u |= 1 << KPF_ZERO_PAGE ;
159
+ }
163
160
164
161
/*
165
162
* Caveats on high order pages: PG_buddy and PG_slab will only be set
You can’t perform that action at this time.
0 commit comments