summaryrefslogtreecommitdiff
path: root/include/linux/mm_types.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2023-08-21 18:08:46 +0200
committerAndrew Morton <akpm@linux-foundation.org>2023-08-24 16:20:28 -0700
commitcfeed8ffe55b37fa10286aaaa1369da00cb88440 (patch)
treecbc7c8618364472fa49497bd220c0c26d0c64719 /include/linux/mm_types.h
parentbad5a3a42a31859705baf39c4fc92173b2716760 (diff)
mm/swap: stop using page->private on tail pages for THP_SWAP
Patch series "mm/swap: stop using page->private on tail pages for THP_SWAP + cleanups". This series stops using page->private on tail pages for THP_SWAP, replaces folio->private by folio->swap for swapcache folios, and starts using "new_folio" for tail pages that we are splitting to remove the usage of page->private for swapcache handling completely. This patch (of 4): Let's stop using page->private on tail pages, making it possible to just unconditionally reuse that field in the tail pages of large folios. The remaining usage of the private field for THP_SWAP is in the THP splitting code (mm/huge_memory.c), that we'll handle separately later. Update the THP_SWAP documentation and sanity checks in mm_types.h and __split_huge_page_tail(). [david@redhat.com: stop using page->private on tail pages for THP_SWAP] Link: https://lkml.kernel.org/r/6f0a82a3-6948-20d9-580b-be1dbf415701@redhat.com Link: https://lkml.kernel.org/r/20230821160849.531668-1-david@redhat.com Link: https://lkml.kernel.org/r/20230821160849.531668-2-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64] Reviewed-by: Yosry Ahmed <yosryahmed@google.com> Cc: Dan Streetman <ddstreet@ieee.org> Cc: Hugh Dickins <hughd@google.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Peter Xu <peterx@redhat.com> Cc: Seth Jennings <sjenning@redhat.com> Cc: Vitaly Wool <vitaly.wool@konsulko.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/mm_types.h')
-rw-r--r--include/linux/mm_types.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 2b9d8be28361..55cd4bc57b8d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -322,11 +322,8 @@ struct folio {
atomic_t _pincount;
#ifdef CONFIG_64BIT
unsigned int _folio_nr_pages;
- /* 4 byte gap here */
- /* private: the union with struct page is transitional */
- /* Fix THP_SWAP to not use tail->private */
- unsigned long _private_1;
#endif
+ /* private: the union with struct page is transitional */
};
struct page __page_1;
};
@@ -347,9 +344,6 @@ struct folio {
/* public: */
struct list_head _deferred_list;
/* private: the union with struct page is transitional */
- unsigned long _avail_2a;
- /* Fix THP_SWAP to not use tail->private */
- unsigned long _private_2a;
};
struct page __page_2;
};
@@ -374,9 +368,6 @@ FOLIO_MATCH(memcg_data, memcg_data);
offsetof(struct page, pg) + sizeof(struct page))
FOLIO_MATCH(flags, _flags_1);
FOLIO_MATCH(compound_head, _head_1);
-#ifdef CONFIG_64BIT
-FOLIO_MATCH(private, _private_1);
-#endif
#undef FOLIO_MATCH
#define FOLIO_MATCH(pg, fl) \
static_assert(offsetof(struct folio, fl) == \
@@ -385,7 +376,6 @@ FOLIO_MATCH(flags, _flags_2);
FOLIO_MATCH(compound_head, _head_2);
FOLIO_MATCH(flags, _flags_2a);
FOLIO_MATCH(compound_head, _head_2a);
-FOLIO_MATCH(private, _private_2a);
#undef FOLIO_MATCH
/**