[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 4 Apr 2024 13:31:37 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Peter Xu <peterx@...hat.com>
Cc: Matthew Wilcox <willy@...radead.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Huacai Chen <chenhuacai@...nel.org>, David
Hildenbrand <david@...hat.com>, Jason Gunthorpe <jgg@...dia.com>, Nathan
Chancellor <nathan@...nel.org>, WANG Xuerui <kernel@...0n.name>, Ryan
Roberts <ryan.roberts@....com>, loongarch@...ts.linux.dev
Subject: Re: [PATCH 1/3] mm: Allow anon exclusive check over hugetlb tail
pages
On Thu, 4 Apr 2024 10:21:21 -0400 Peter Xu <peterx@...hat.com> wrote:
> Andrew, could you help update with Matthew's fixup? The comment is
> definitely better than what I wrote in all cases.
From: Andrew Morton <akpm@...ux-foundation.org>
Subject: mm-allow-anon-exclusive-check-over-hugetlb-tail-pages-fix
Date: Thu Apr 4 01:27:47 PM PDT 2024
simplify PageAnonExclusive(), per Matthew
Link: https://lkml.kernel.org/r/Zg3u5Sh9EbbYPhaI@casper.infradead.org
Cc: David Hildenbrand <david@...hat.com>
Cc: Huacai Chen <chenhuacai@...nel.org>
Cc: Jason Gunthorpe <jgg@...dia.com>
Cc: Matthew Wilcox (Oracle) <willy@...radead.org>
Cc: Nathan Chancellor <nathan@...nel.org>
Cc: Peter Xu <peterx@...hat.com>
Cc: Ryan Roberts <ryan.roberts@....com>
Cc: WANG Xuerui <kernel@...0n.name>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
include/linux/page-flags.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/include/linux/page-flags.h~mm-allow-anon-exclusive-check-over-hugetlb-tail-pages-fix
+++ a/include/linux/page-flags.h
@@ -1096,11 +1096,10 @@ static __always_inline int PageAnonExclu
{
VM_BUG_ON_PGFLAGS(!PageAnon(page), page);
/*
- * Allow the anon-exclusive check to work on hugetlb tail pages.
- * Here hugetlb pages will always guarantee the anon-exclusiveness
- * of the head page represents the tail pages.
+ * HugeTLB stores this information on the head page; THP keeps it per
+ * page
*/
- if (PageHuge(page) && !PageHead(page))
+ if (PageHuge(page))
page = compound_head(page);
return test_bit(PG_anon_exclusive, &PF_ANY(page, 1)->flags);
}
_
Powered by blists - more mailing lists