From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Muchun Song <songmuchun@bytedance.com>,
will@kernel.org, akpm@linux-foundation.org, david@redhat.com,
bodeddub@amazon.com, osalvador@suse.de, mike.kravetz@oracle.com,
rientjes@google.com, mark.rutland@arm.com,
catalin.marinas@arm.com, james.morse@arm.com, 21cnbao@gmail.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
duanxiongchun@bytedance.com, fam.zheng@bytedance.com,
smuchun@gmail.com
Subject: Re: [PATCH v4 2/2] arm64: mm: hugetlb: Enable HUGETLB_PAGE_FREE_VMEMMAP for arm64
Date: Mon, 11 Apr 2022 15:42:52 +0530 [thread overview]
Message-ID: <5b27aa62-da2b-e19d-3378-be5102ebebb6@arm.com> (raw)
In-Reply-To: <20220331065640.5777-2-songmuchun@bytedance.com>
On 3/31/22 12:26, Muchun Song wrote:
> --- a/arch/arm64/mm/flush.c
> +++ b/arch/arm64/mm/flush.c
> @@ -68,6 +68,19 @@ EXPORT_SYMBOL_GPL(__sync_icache_dcache);
> */
> void flush_dcache_page(struct page *page)
> {
> + /*
> + * Only the head page's flags of HugeTLB can be cleared since the tail
> + * vmemmap pages associated with each HugeTLB page are mapped with
> + * read-only when CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is enabled (more
> + * details can refer to vmemmap_remap_pte()). Although
Did you see real permission fault when flush_dcache_page() accessed remapped
tail pages, with readonly vmemmap ? OR this change is from code inspection ?
> + * __sync_icache_dcache() only set PG_dcache_clean flag on the head
> + * page struct, some tail page structs still can be seen the flag is
Sentence here needs restructuring .... ^^^^^^^^^^^^^^^^^^
> + * set since the head vmemmap page frame is reused (more details can
> + * refer to the comments above page_fixed_fake_head()).
> + */
> + if (hugetlb_free_vmemmap_enabled() && PageHuge(page))
> + page = compound_head(page);
This should also be applicable to any other platform with both configs enabled
i.e ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE and ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP ?
If yes, then how to ensure that the platforms change flush_dcache_page() before
subscribing into ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP ?
> +
> if (test_bit(PG_dcache_clean, &page->flags))
> clear_bit(PG_dcache_clean, &page->flags);
> }
next prev parent reply other threads:[~2022-04-11 10:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 6:56 [PATCH v4 1/2] mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP Muchun Song
2022-03-31 6:56 ` [PATCH v4 2/2] arm64: mm: hugetlb: Enable HUGETLB_PAGE_FREE_VMEMMAP for arm64 Muchun Song
2022-03-31 22:31 ` Barry Song
2022-04-04 9:26 ` Anshuman Khandual
2022-04-04 12:01 ` Muchun Song
2022-04-05 3:34 ` Anshuman Khandual
2022-04-05 3:49 ` Muchun Song
2022-04-05 4:45 ` Anshuman Khandual
2022-04-05 8:38 ` Muchun Song
2022-04-11 9:17 ` Anshuman Khandual
2022-04-11 10:40 ` Muchun Song
2022-04-11 10:12 ` Anshuman Khandual [this message]
2022-04-11 11:55 ` Muchun Song
2022-04-13 10:33 ` Anshuman Khandual
2022-04-13 14:59 ` Muchun Song
2022-03-31 8:42 ` [PATCH v4 1/2] mm: hugetlb_vmemmap: introduce ARCH_WANT_HUGETLB_PAGE_FREE_VMEMMAP David Hildenbrand
2022-03-31 8:48 ` Muchun Song
2022-03-31 8:50 ` David Hildenbrand
2022-03-31 8:53 ` Muchun Song
2022-03-31 22:19 ` Barry Song
2022-04-04 9:05 ` Anshuman Khandual
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=5b27aa62-da2b-e19d-3378-be5102ebebb6@arm.com \
--to=anshuman.khandual@arm.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bodeddub@amazon.com \
--cc=catalin.marinas@arm.com \
--cc=david@redhat.com \
--cc=duanxiongchun@bytedance.com \
--cc=fam.zheng@bytedance.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=mike.kravetz@oracle.com \
--cc=osalvador@suse.de \
--cc=rientjes@google.com \
--cc=smuchun@gmail.com \
--cc=songmuchun@bytedance.com \
--cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).