[PATCH] arch/powerpc/mm: Enable compound page check for both THP and HugeTLB

Michael Ellerman mpe at ellerman.id.au
Tue Mar 24 17:38:17 AEDT 2020


"Aneesh Kumar K.V" <aneesh.kumar at linux.ibm.com> writes:
> THP config can result in compound pages. Make sure kernel enables the
> PageCompound() check when only THP is enabled.

Or else what happens ... nothing, rampant data corruption, something in
between?

And "when only THP is enabled" is not very clear, AFAIK there is no
relation between CONFIG_TRANSPARENT_HUGEPAGE and CONFIG_HUGETLB_PAGE.

You mean when either or both of THP or HUGETLB is enabled right?

cheers


> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 9b4f5fb719e0..b03cbddf9054 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -485,7 +485,7 @@ EXPORT_SYMBOL(flush_dcache_page);
>  
>  void flush_dcache_icache_page(struct page *page)
>  {
> -#ifdef CONFIG_HUGETLB_PAGE
> +#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE)
>  	if (PageCompound(page)) {
>  		flush_dcache_icache_hugepage(page);
>  		return;
> -- 
> 2.25.1


More information about the Linuxppc-dev mailing list