aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox <[email protected]>2018-06-07 17:08:35 -0700
committerLinus Torvalds <[email protected]>2018-06-07 17:34:37 -0700
commitb21999da02f891aafa362252f4db7ba5c34a9a8d (patch)
tree9e105640596888be72a145b04d147bea5e318d08
parent7d27a04bb2b5bd665f147439d18ae236080eef32 (diff)
mm: move _refcount out of struct page union
Keeping the refcount in the union only encourages people to put something else in the union which will overlap with _refcount and eventually explode messily. pahole reports no fields change location. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Acked-by: Kirill A. Shutemov <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Jérôme Glisse <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Andrey Ryabinin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--include/linux/mm_types.h25
1 files changed, 10 insertions, 15 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index bcc5ee8b7b07..0b0c0e224011 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -113,7 +113,13 @@ struct page {
};
};
- union {
+ union { /* This union is 4 bytes in size. */
+ /*
+ * If the page can be mapped to userspace, encodes the number
+ * of times this page is referenced by a page table.
+ */
+ atomic_t _mapcount;
+
/*
* If the page is neither PageSlab nor mappable to userspace,
* the value stored here may help determine what this page
@@ -124,22 +130,11 @@ struct page {
unsigned int active; /* SLAB */
int units; /* SLOB */
-
- struct { /* Page cache */
- /*
- * Count of ptes mapped in mms, to show when
- * page is mapped & limit reverse map searches.
- */
- atomic_t _mapcount;
-
- /*
- * Usage count, *USE WRAPPER FUNCTION* when manual
- * accounting. See page_ref.h
- */
- atomic_t _refcount;
- };
};
+ /* Usage count. *DO NOT USE DIRECTLY*. See page_ref.h */
+ atomic_t _refcount;
+
/*
* WARNING: bit 0 of the first word encode PageTail(). That means
* the rest users of the storage space MUST NOT use the bit to