Re: Flushing transparent hugepages

2020-09-09 Thread Aneesh Kumar K.V
Matthew Wilcox writes: > PowerPC has special handling of hugetlbfs pages. Well, that's what > the config option says, but actually it handles THP as well. If > the config option is enabled. > > #ifdef CONFIG_HUGETLB_PAGE > if (PageCompound(page)) { > flush_dcache_icache_

Re: [PATCH v4 00/13] mm/debug_vm_pgtable fixes

2020-09-08 Thread Aneesh Kumar K.V
Gerald Schaefer writes: > On Fri, 4 Sep 2020 18:01:15 +0200 > Gerald Schaefer wrote: > > [...] >> >> BTW2, a quick test with this change (so far) made the issues on s390 >> go away: >> >> @@ -1069,7 +1074,7 @@ static int __init debug_vm_pgtable(void) >> spin_unlock(ptl); >> >> #ifnde

Re: [PATCH v3 12/13] mm/debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-09-02 Thread Aneesh Kumar K.V
Anshuman Khandual writes: > On 09/01/2020 12:00 PM, Aneesh Kumar K.V wrote: >> On 9/1/20 9:33 AM, Anshuman Khandual wrote: >>> >>> >>> On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: >>>> The seems to be missing quite a lot of details

Re: [PATCH v3 13/13] mm/debug_vm_pgtable: populate a pte entry before fetching it

2020-09-01 Thread Aneesh Kumar K.V
On 9/2/20 9:19 AM, Anshuman Khandual wrote: On 09/01/2020 03:28 PM, Aneesh Kumar K.V wrote: On 9/1/20 1:08 PM, Anshuman Khandual wrote: On 09/01/2020 12:07 PM, Aneesh Kumar K.V wrote: On 9/1/20 8:55 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote

Re: [PATCH v3 13/13] mm/debug_vm_pgtable: populate a pte entry before fetching it

2020-09-01 Thread Aneesh Kumar K.V
On 9/1/20 1:08 PM, Anshuman Khandual wrote: On 09/01/2020 12:07 PM, Aneesh Kumar K.V wrote: On 9/1/20 8:55 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: pte_clear_tests operate on an existing pte entry. Make sure that is not a none pte entry. Signed-off-by

Re: [PATCH v3 09/13] mm/debug_vm_pgtable/locks: Move non page table modifying test together

2020-09-01 Thread Aneesh Kumar K.V
[   17.080644] [ cut here ] [   17.081342] kernel BUG at mm/pgtable-generic.c:164! [   17.082091] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [   17.082977] Modules linked in: [   17.083481] CPU: 79 PID: 1 Comm: swapper/0 Tainted: G    W 5.9.0-rc2-00105-g

Re: [PATCH v3 03/13] mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-09-01 Thread Aneesh Kumar K.V
On 9/1/20 1:16 PM, Anshuman Khandual wrote: On 09/01/2020 01:06 PM, Aneesh Kumar K.V wrote: On 9/1/20 1:02 PM, Anshuman Khandual wrote: On 09/01/2020 11:51 AM, Aneesh Kumar K.V wrote: On 9/1/20 8:45 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: ppc64 use

Re: [PATCH v3 08/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-09-01 Thread Aneesh Kumar K.V
On 9/1/20 12:20 PM, Christophe Leroy wrote: Le 01/09/2020 à 08:25, Aneesh Kumar K.V a écrit : On 9/1/20 8:52 AM, Anshuman Khandual wrote: There is a checkpatch.pl warning here. WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #7: Architectures like

Re: [PATCH v3 03/13] mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-09-01 Thread Aneesh Kumar K.V
On 9/1/20 1:02 PM, Anshuman Khandual wrote: On 09/01/2020 11:51 AM, Aneesh Kumar K.V wrote: On 9/1/20 8:45 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off

Re: [PATCH v3 09/13] mm/debug_vm_pgtable/locks: Move non page table modifying test together

2020-08-31 Thread Aneesh Kumar K.V
On 9/1/20 9:11 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: This will help in adding proper locks in a later patch It really makes sense to classify these tests here as static and dynamic. Static are the ones that test via page table entry values modification

Re: [PATCH v3 13/13] mm/debug_vm_pgtable: populate a pte entry before fetching it

2020-08-31 Thread Aneesh Kumar K.V
On 9/1/20 8:55 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: pte_clear_tests operate on an existing pte entry. Make sure that is not a none pte entry. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 6 -- 1 file changed, 4 insertions(+), 2

Re: [PATCH v3 12/13] mm/debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-31 Thread Aneesh Kumar K.V
On 9/1/20 9:33 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: The seems to be missing quite a lot of details w.r.t allocating the correct pgtable_t page (huge_pte_alloc()), holding the right lock (huge_pte_lock()) etc. The vma used is also not a hugetlb VMA

Re: [PATCH v3 08/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-08-31 Thread Aneesh Kumar K.V
On 9/1/20 8:52 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: Architectures like ppc64 use deposited page table while updating the huge pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 10 +++--- 1 file changed, 7 insertions(+), 3

Re: [PATCH v3 06/13] mm/debug_vm_pgtable/THP: Mark the pte entry huge before using set_pmd/pud_at

2020-08-31 Thread Aneesh Kumar K.V
On 9/1/20 8:51 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: kernel expects entries to be marked huge before we use set_pmd_at()/set_pud_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 21 - 1 file changed, 12

Re: [PATCH v3 03/13] mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-08-31 Thread Aneesh Kumar K.V
On 9/1/20 8:45 AM, Anshuman Khandual wrote: On 08/27/2020 01:34 PM, Aneesh Kumar K.V wrote: ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 13 ++--- 1 file changed, 10

[PATCH v3 11/13] mm/debug_vm_pgtable/pmd_clear: Don't use pmd/pud_clear on pte entries

2020-08-27 Thread Aneesh Kumar K.V
pmd_clear() should not be used to clear pmd level pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 0a6e771ebd13..a188b6e4e37e 100644 --- a/mm

[PATCH v3 13/13] mm/debug_vm_pgtable: populate a pte entry before fetching it

2020-08-27 Thread Aneesh Kumar K.V
pte_clear_tests operate on an existing pte entry. Make sure that is not a none pte entry. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 21329c7d672f

[PATCH v3 12/13] mm/debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-27 Thread Aneesh Kumar K.V
ppc64. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 4 1 file changed, 4 insertions(+) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index a188b6e4e37e..21329c7d672f 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -813,6 +813,7 @@ static void

[PATCH v3 09/13] mm/debug_vm_pgtable/locks: Move non page table modifying test together

2020-08-27 Thread Aneesh Kumar K.V
This will help in adding proper locks in a later patch Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 52 --- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 0ce5c6a24c5b

[PATCH v3 10/13] mm/debug_vm_pgtable/locks: Take correct page table lock

2020-08-27 Thread Aneesh Kumar K.V
Make sure we call pte accessors with correct lock held. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 78c8af3445ac

[PATCH v3 07/13] mm/debug_vm_pgtable/set_pte/pmd/pud: Don't use set_*_at to update an existing pte entry

2020-08-27 Thread Aneesh Kumar K.V
set_pte_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pte_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --

[PATCH v3 06/13] mm/debug_vm_pgtable/THP: Mark the pte entry huge before using set_pmd/pud_at

2020-08-27 Thread Aneesh Kumar K.V
kernel expects entries to be marked huge before we use set_pmd_at()/set_pud_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index

[PATCH v3 08/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-08-27 Thread Aneesh Kumar K.V
Architectures like ppc64 use deposited page table while updating the huge pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index f9f6358899a8

[PATCH v3 05/13] mm/debug_vm_pgtable/savedwrite: Enable savedwrite test with CONFIG_NUMA_BALANCING

2020-08-27 Thread Aneesh Kumar K.V
enable the test only when CONFIG_NUMA_BALANCING is enabled and use protnone protflags. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 28f9d0558c20

[PATCH v3 02/13] powerpc/mm: Move setting pte specific flags to pfn_pte

2020-08-27 Thread Aneesh Kumar K.V
setting _PAGE_PTE bit. We will remove that after a few releases. With respect to huge pmd entries, pmd_mkhuge() takes care of adding the _PAGE_PTE bit. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 15 +-- arch/powerpc/include/asm/nohash/pgtable.h

[PATCH v3 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support.

2020-08-27 Thread Aneesh Kumar K.V
ppc64 supports huge vmap only with radix translation. Hence use arch helper to determine the huge vmap support. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm

[PATCH v3 03/13] mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-08-27 Thread Aneesh Kumar K.V
ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index

[PATCH v3 00/13] mm/debug_vm_pgtable fixes

2020-08-27 Thread Aneesh Kumar K.V
test specific pfn_pte and pfn_pmd. * Update ppc64 page table helper to add _PAGE_PTE Aneesh Kumar K.V (13): powerpc/mm: Add DEBUG_VM WARN for pmd_clear powerpc/mm: Move setting pte specific flags to pfn_pte mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value mm

[PATCH v3 01/13] powerpc/mm: Add DEBUG_VM WARN for pmd_clear

2020-08-27 Thread Aneesh Kumar K.V
With the hash page table, the kernel should not use pmd_clear for clearing huge pte entries. Add a DEBUG_VM WARN to catch the wrong usage. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch

Re: Build error due to commit 458aa76d132dc ("mm/thp/migration: switch from flush_tlb_range to flush_pmd_tlb_range")

2016-03-21 Thread Aneesh Kumar K.V
Guenter Roeck writes: > [ text/plain ] > Hi, > > Your commit 458aa76d132dc1 ("mm/thp/migration: switch from flush_tlb_range > to flush_pmd_tlb_range") causes a build error when building > arcv2:vdk_hs38_smp_defconfig. > > include/asm-generic/pgtable.h:799:45: note: in expansion of macro ‘BUILD_BU

Re: [PATCH] mm, thp: khugepaged: call pte flush at the time of collapse

2016-02-09 Thread Aneesh Kumar K.V
touching the generic pmdp_collapse_flush() > by defining a ARC version, but that defeats the purpose of generic > version, plus sementically this is the right thing to do. > > Fixes STAR 9000961194: LMBench on AXS103 triggering duplicate TLB > exceptions with super pages > > Cc: Kir