thp: remove PG_buddy
PG_buddy can be converted to _mapcount == -2. So the PG_compound_lock can be added to page->flags without overflowing (because of the sparse section bits increasing) with CONFIG_X86_PAE=y and CONFIG_X86_PAT=y. This also has to move the memory hotplug code from _mapcount to lru.next to avoid any risk of clashes. We can't use lru.next for PG_buddy removal, but memory hotplug can use lru.next even more easily than the mapcount instead. Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
21ae5b0175
commit
5f24ce5fd3
@@ -116,15 +116,17 @@ u64 stable_page_flags(struct page *page)
|
||||
if (PageHuge(page))
|
||||
u |= 1 << KPF_HUGE;
|
||||
|
||||
/*
|
||||
* Caveats on high order pages: page->_count will only be set
|
||||
* -1 on the head page; SLUB/SLQB do the same for PG_slab;
|
||||
* SLOB won't set PG_slab at all on compound pages.
|
||||
*/
|
||||
if (PageBuddy(page))
|
||||
u |= 1 << KPF_BUDDY;
|
||||
|
||||
u |= kpf_copy_bit(k, KPF_LOCKED, PG_locked);
|
||||
|
||||
/*
|
||||
* Caveats on high order pages:
|
||||
* PG_buddy will only be set on the head page; SLUB/SLQB do the same
|
||||
* for PG_slab; SLOB won't set PG_slab at all on compound pages.
|
||||
*/
|
||||
u |= kpf_copy_bit(k, KPF_SLAB, PG_slab);
|
||||
u |= kpf_copy_bit(k, KPF_BUDDY, PG_buddy);
|
||||
|
||||
u |= kpf_copy_bit(k, KPF_ERROR, PG_error);
|
||||
u |= kpf_copy_bit(k, KPF_DIRTY, PG_dirty);
|
||||
|
Reference in New Issue
Block a user