[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b27aa62-da2b-e19d-3378-be5102ebebb6@arm.com>
Date: Mon, 11 Apr 2022 15:42:52 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Muchun Song <songmuchun@...edance.com>, will@...nel.org,
akpm@...ux-foundation.org, david@...hat.com, bodeddub@...zon.com,
osalvador@...e.de, mike.kravetz@...cle.com, rientjes@...gle.com,
mark.rutland@....com, catalin.marinas@....com, james.morse@....com,
21cnbao@...il.com
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, duanxiongchun@...edance.com,
fam.zheng@...edance.com, smuchun@...il.com
Subject: Re: [PATCH v4 2/2] arm64: mm: hugetlb: Enable
HUGETLB_PAGE_FREE_VMEMMAP for arm64
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);
> }
Powered by blists - more mailing lists