arch/powerpc/mm: Enable compound page check for both THP and HugeTLB
PATCH 1/1 arch/powerpc/mm: Enable compound page check for both THP and HugeTLB
THP config can result in compound pages. Make sure kernel enables the PageCompound() check when only THP is enabled.
--- arch/powerpc/mm/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/mem.c +1 -1
@@ -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 ;
Signature · 1 line
2.25.1
Michael Ellerman
reviewerQuoted 2 lines · Aneesh Kumar K.V
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
Quoted 15 lines
arch/powerpc/mm/mem.c +1
-1@@ -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 ;Signature · 1 line
2.25.1
Quoted 7 lines · Michael Ellerman
Quoted 2 lines · Aneesh Kumar K.V
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?
We can get a stale icache that can result in undefined behavior?
Quoted 3 lines
And "when only THP is enabled" is not very clear, AFAIK there is no relation between
CONFIG_TRANSPARENT_HUGEPAGEandCONFIG_HUGETLB_PAGE.
yes, there is no relation between them. But the way current code is enabled if we have both enabled, we will find that if (PageCompound(page)) check present which will handle THP case too.
Now with current code if we have CONFIG_HUGETLB_PAGE disabled, we compile out if (pageCompound(page)) check and hence don't invalidate compound pages correctly (THP create compound pages here)
Quoted 20 lines
You mean when either or both of THP or HUGETLB is enabled right?
cheers
Quoted 15 lines
arch/powerpc/mm/mem.c +1
-1@@ -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 ;Signature · 1 line
2.25.1