mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mm/huge_memory: ensure huge_zero_folio won't have large_rmappable flag set
Ensure huge_zero_folio won't have large_rmappable flag set. So it can be
reported as thp,zero correctly through stable_page_flags().
Link: https://lkml.kernel.org/r/20240914015306.3656791-1-linmiaohe@huawei.com
Fixes: 5691753d73
("mm: convert huge_zero_page to huge_zero_folio")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
98b74bb4d7
commit
2a1b8648d9
1 changed files with 2 additions and 0 deletions
|
@ -220,6 +220,8 @@ retry:
|
||||||
count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED);
|
count_vm_event(THP_ZERO_PAGE_ALLOC_FAILED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/* Ensure zero folio won't have large_rmappable flag set. */
|
||||||
|
folio_clear_large_rmappable(zero_folio);
|
||||||
preempt_disable();
|
preempt_disable();
|
||||||
if (cmpxchg(&huge_zero_folio, NULL, zero_folio)) {
|
if (cmpxchg(&huge_zero_folio, NULL, zero_folio)) {
|
||||||
preempt_enable();
|
preempt_enable();
|
||||||
|
|
Loading…
Add table
Reference in a new issue