aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/huge_mm.h
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2023-01-11 14:29:10 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-02-02 22:33:00 -0800
commit4375a553f46c6cb66d1711d8f514dfdf34ce74b0 (patch)
tree564bd1c2948ac25cd7ef406f3073ddc53d67430e /include/linux/huge_mm.h
parentdoc: correct struct folio kernel-doc (diff)
downloadwireguard-linux-4375a553f46c6cb66d1711d8f514dfdf34ce74b0.tar.xz
wireguard-linux-4375a553f46c6cb66d1711d8f514dfdf34ce74b0.zip
mm: move page->deferred_list to folio->_deferred_list
Remove the entire block of definitions for the second tail page, and add the deferred list to the struct folio. This actually moves _deferred_list to a different offset in struct folio because I don't see a need to include the padding. This lets us use list_for_each_entry_safe() in deferred_split_scan() and avoid a number of calls to compound_head(). Link: https://lkml.kernel.org/r/20230111142915.1001531-25-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/huge_mm.h')
-rw-r--r--include/linux/huge_mm.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index a1341fdcf666..aacfcb02606f 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -295,11 +295,10 @@ static inline bool thp_migration_supported(void)
static inline struct list_head *page_deferred_list(struct page *page)
{
- /*
- * See organization of tail pages of compound page in
- * "struct page" definition.
- */
- return &page[2].deferred_list;
+ struct folio *folio = (struct folio *)page;
+
+ VM_BUG_ON_FOLIO(folio_order(folio) < 2, folio);
+ return &folio->_deferred_list;
}
#else /* CONFIG_TRANSPARENT_HUGEPAGE */