Messages in this thread Patch in this message | | | Date | Wed, 9 Nov 2022 18:13:50 -0800 (PST) | From | Hugh Dickins <> | Subject | [PATCH 1/3 fix] mm,hugetlb: use folio fields in second tail page: fix |
| |
Per review comment from Sidhartha: prefix folio's page_1 and page_2 with double underscore, to underscore that they are fillers for alignment rather than directly usable members of the union (whereas the first "struct page page" is important for folio<->page conversions).
Per review comment from Kirill: give folio's _flags_2 and _head_2 a line of documentation each, though both of them "Do not use" (I think _flags_1 should be enough for now, and shouldn't recommend spilling to _flags_2).
Signed-off-by: Hugh Dickins <hughd@google.com> --- include/linux/mm_types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 5d28bbd19e3f..1b8db9b4a7e6 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -275,6 +275,8 @@ struct page { * @_subpages_mapcount: Do not use directly, call folio_mapcount(). * @_pincount: Do not use directly, call folio_maybe_dma_pinned(). * @_folio_nr_pages: Do not use directly, call folio_nr_pages(). + * @_flags_2: For alignment. Do not use. + * @_head_2: Points to the folio. Do not use. * @_hugetlb_subpool: Do not use directly, use accessor in hugetlb.h. * @_hugetlb_cgroup: Do not use directly, use accessor in hugetlb_cgroup.h. * @_hugetlb_cgroup_rsvd: Do not use directly, use accessor in hugetlb_cgroup.h. @@ -330,7 +332,7 @@ struct folio { unsigned int _folio_nr_pages; #endif }; - struct page page_1; + struct page __page_1; }; union { struct { @@ -341,7 +343,7 @@ struct folio { void *_hugetlb_cgroup_rsvd; void *_hugetlb_hwpoison; }; - struct page page_2; + struct page __page_2; }; }; -- 2.35.3
| |