Commit 4cf7c8bf authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

mm: remove misleading alignment claims

The "third double word block" isn't on 32-bit systems.  The layout looks
like this:

	unsigned long flags;
	struct address_space *mapping
	pgoff_t index;
	atomic_t _mapcount;
	atomic_t _refcount;

which is 32 bytes on 64-bit, but 20 bytes on 32-bit.  Nobody is trying to
use the fact that it's double-word aligned today, so just remove the
misleading claims.

Link: http://lkml.kernel.org/r/20171220155552.15884-4-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: default avatarChristoph Lameter <cl@linux.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ca9c88c7
...@@ -33,11 +33,11 @@ struct hmm; ...@@ -33,11 +33,11 @@ struct hmm;
* a page, though if it is a pagecache page, rmap structures can tell us * a page, though if it is a pagecache page, rmap structures can tell us
* who is mapping it. * who is mapping it.
* *
* The objects in struct page are organized in double word blocks in * SLUB uses cmpxchg_double() to atomically update its freelist and
* order to allows us to use atomic double word operations on portions * counters. That requires that freelist & counters be adjacent and
* of struct page. That is currently only used by slub but the arrangement * double-word aligned. We align all struct pages to double-word
* allows the use of atomic double word operations on the flags/mapping * boundaries, and ensure that 'freelist' is aligned within the
* and lru list pointers also. * struct.
*/ */
#ifdef CONFIG_HAVE_ALIGNED_STRUCT_PAGE #ifdef CONFIG_HAVE_ALIGNED_STRUCT_PAGE
#define _struct_page_alignment __aligned(2 * sizeof(unsigned long)) #define _struct_page_alignment __aligned(2 * sizeof(unsigned long))
...@@ -113,8 +113,6 @@ struct page { ...@@ -113,8 +113,6 @@ struct page {
}; };
/* /*
* Third double word block
*
* WARNING: bit 0 of the first word encode PageTail(). That means * WARNING: bit 0 of the first word encode PageTail(). That means
* the rest users of the storage space MUST NOT use the bit to * the rest users of the storage space MUST NOT use the bit to
* avoid collision and false-positive PageTail(). * avoid collision and false-positive PageTail().
...@@ -175,7 +173,6 @@ struct page { ...@@ -175,7 +173,6 @@ struct page {
#endif #endif
}; };
/* Remainder is not double word aligned */
union { union {
unsigned long private; /* Mapping-private opaque data: unsigned long private; /* Mapping-private opaque data:
* usually used for buffer_heads * usually used for buffer_heads
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment