From: Andrew Morton <akpm@linux-foundation.org>
To: Peter Xu <peterx@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Huacai Chen <chenhuacai@kernel.org>,
David Hildenbrand <david@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Nathan Chancellor <nathan@kernel.org>,
WANG Xuerui <kernel@xen0n.name>,
Ryan Roberts <ryan.roberts@arm.com>,
loongarch@lists.linux.dev
Subject: Re: [PATCH 1/3] mm: Allow anon exclusive check over hugetlb tail pages
Date: Thu, 4 Apr 2024 13:31:37 -0700 [thread overview]
Message-ID: <20240404133137.560d15c1a3bc7176424901fb@linux-foundation.org> (raw)
In-Reply-To: <Zg63YZaXqYdSLHG-@x1n>
On Thu, 4 Apr 2024 10:21:21 -0400 Peter Xu <peterx@redhat.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@linux-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@redhat.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: WANG Xuerui <kernel@xen0n.name>
Signed-off-by: Andrew Morton <akpm@linux-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);
}
_
next prev parent reply other threads:[~2024-04-04 20:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 1:32 [PATCH 0/3] mm/gup: fixups for hugetlb gup rework series peterx
2024-04-03 1:32 ` [PATCH 1/3] mm: Allow anon exclusive check over hugetlb tail pages peterx
2024-04-03 7:37 ` David Hildenbrand
2024-04-04 0:05 ` Matthew Wilcox
2024-04-04 13:45 ` Peter Xu
2024-04-04 14:06 ` Matthew Wilcox
2024-04-04 14:21 ` Peter Xu
2024-04-04 20:31 ` Andrew Morton [this message]
2024-04-04 20:36 ` Peter Xu
2024-04-03 1:32 ` [PATCH 2/3] fixup! mm/gup: handle huge pmd for follow_pmd_mask() peterx
2024-04-03 1:32 ` [PATCH 3/3] fixup! mm/arch: provide pud_pfn() fallback peterx
2024-04-03 11:06 ` [PATCH 0/3] mm/gup: fixups for hugetlb gup rework series Ryan Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240404133137.560d15c1a3bc7176424901fb@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=chenhuacai@kernel.org \
--cc=david@redhat.com \
--cc=jgg@nvidia.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=loongarch@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox