[PATCH 15/16] powerpc/book3s64/radix: Add support for vmemmap optimization for radix

2023-06-05 Thread Aneesh Kumar K.V
With 2M PMD-level mapping, we require 32 struct pages and a single vmemmap page can contain 1024 struct pages (PAGE_SIZE/sizeof(struct page)). Hence with 64K page size, we don't use vmemmap deduplication for PMD-level mapping. Signed-off-by: Aneesh Kumar K.V --- Documentation/mm

[PATCH 14/16] powerpc/book3s64/vmemmap: Switch radix to use a different vmemmap handling function

2023-06-05 Thread Aneesh Kumar K.V
need to do the above check even at the PAGE_SIZE granularity. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/radix.h | 2 + arch/powerpc/include/asm/pgtable.h | 3 + arch/powerpc/mm/book3s64/radix_pgtable.c | 293 +++-- arch/powerpc/mm/init_64

[PATCH 13/16] powerpc/book3s64/mm: Enable transparent pud hugepage

2023-06-05 Thread Aneesh Kumar K.V
expected pte bit combination is _PAGE_PTE | _PAGE_DEVMAP. Some of the helpers are never expected to get called on hash translation and hence is marked to call BUG() in such a case. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 156 -- arch

[PATCH 12/16] mm/vmemmap optimization: Split hugetlb and devdax vmemmap optimization

2023-06-05 Thread Aneesh Kumar K.V
is not enabled for them. With this change, arm64 should be able to select DAX optimization [1] commit 060a2c92d1b6 ("arm64: mm: hugetlb: Disable HUGETLB_PAGE_OPTIMIZE_VMEMMAP") Signed-off-by: Aneesh Kumar K.V --- arch/loongarch/Kconfig | 2 +- arch/riscv/Kconfig | 2 +- arch/x86/Kconfig

[PATCH 11/16] mm/huge pud: Use transparent huge pud helpers only with CONFIG_TRANSPARENT_HUGEPAGE

2023-06-05 Thread Aneesh Kumar K.V
pudp_set_wrprotect and move_huge_pud helpers are only used when CONFIG_TRANSPARENT_HUGEPAGE is enabled. Similar to pmdp_set_wrprotect and move_huge_pmd_helpers use architecture override only if CONFIG_TRANSPARENT_HUGEPAGE is set Signed-off-by: Aneesh Kumar K.V --- include/linux/pgtable.h | 2

[PATCH 10/16] mm: Add __HAVE_ARCH_PUD_SAME similar to __HAVE_ARCH_P4D_SAME

2023-06-05 Thread Aneesh Kumar K.V
This helps architectures to override pmd_same and pud_same independently. Signed-off-by: Aneesh Kumar K.V --- include/linux/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 2fe19720075e..8c5174d1f9db 100644 --- a/include

[PATCH 09/16] mm/vmemmap: Allow architectures to override how vmemmap optimization works

2023-06-05 Thread Aneesh Kumar K.V
Architectures like powerpc will like to use different page table allocators and mapping mechanisms to implement vmemmap optimization. Similar to vmemmap_populate allow architectures to implement vmemap_populate_compound_pages Signed-off-by: Aneesh Kumar K.V --- mm/sparse-vmemmap.c | 3 +++ 1

[PATCH 08/16] mm/vmemmap: Improve vmemmap_can_optimize and allow architectures to override

2023-06-05 Thread Aneesh Kumar K.V
MMU translation). Hence allow architecture override. Signed-off-by: Aneesh Kumar K.V --- include/linux/mm.h | 30 ++ mm/mm_init.c | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 27ce77080c79

[PATCH 07/16] mm: Change pudp_huge_get_and_clear_full take vm_area_struct as arg

2023-06-05 Thread Aneesh Kumar K.V
We will use this in a later patch to do tlb flush when clearing pud entries on powerpc. This is similar to commit 93a98695f2f9 ("mm: change pmdp_huge_get_and_clear_full take vm_area_struct as arg") Signed-off-by: Aneesh Kumar K.V --- include/linux/pgtable.h | 4 ++-- mm/debug_vm

[PATCH 06/16] mm/hugepage pud: Allow arch-specific helper function to check huge page pud support

2023-06-05 Thread Aneesh Kumar K.V
Architectures like powerpc would like to enable transparent huge page pud support only with radix translation. To support that add has_transparent_pud_hugepage() helper that architectures can override. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/pfn_devs.c | 2 +- include/linux/pgtable.h

[PATCH 05/16] powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary

2023-06-05 Thread Aneesh Kumar K.V
Without this fix, the last subsection vmemmap can end up in memory even if the namespace is created with -M mem and has sufficient space in the altmap area. Fixes: cf387d9644d8 ("libnvdimm/altmap: Track namespace boundaries in altmap") Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/

[PATCH 04/16] powerpc/book3s64/mm: Use PAGE_KERNEL instead of opencoding

2023-06-05 Thread Aneesh Kumar K.V
No functional change in this patch. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_pgtable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 15a099e53cde

[PATCH 03/16] powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo

2023-06-05 Thread Aneesh Kumar K.V
: 0 kB DirectMap64k: 0 kB DirectMap2M:104857600 kB DirectMap1G: 0 kB Fixes: a2dc009afa9a ("powerpc/mm/book3s/radix: Add mapping statistics") Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_pgtable.c | 34 +++- 1 fi

[PATCH 02/16] powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix

2023-06-05 Thread Aneesh Kumar K.V
This should not be within CONFIG_PPC_64S_HASHS_MMU. We use mmu_vmemmap_psize on radix while mapping the vmemmap area. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_pgtable.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b

[PATCH 01/16] powerpc/mm/book3s64: Use pmdp_ptep helper instead of typecasting.

2023-06-05 Thread Aneesh Kumar K.V
No functional change in this patch. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 2297aa764ecd

[PATCH 00/16] Add support for DAX vmemmap optimization for ppc64

2023-06-05 Thread Aneesh Kumar K.V
Split hugetlb and d Aneesh Kumar K.V (16): powerpc/mm/book3s64: Use pmdp_ptep helper instead of typecasting. powerpc/book3s64/mm: mmu_vmemmap_psize is used by radix powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo powerpc/book3s64/mm: Use PAGE_KERNEL instead of opencoding powerpc/m

Re: [PATCH] powerpc/64s/radix: Fix soft dirty tracking

2023-05-14 Thread Aneesh Kumar K.V
g _PAGE_SOFTDIRTY to the set of bits that are able to be > changed in radix__ptep_set_access_flags(). > Reviewed-by: Aneesh Kumar K.V > Fixes: b0b5e9b13047 ("powerpc/mm/radix: Add radix pte #defines") > Cc: sta...@vger.kernel.org # v4.7+ > Reported-by: Dan Horák > Link: > https://lor

[PATCH v2] powerpc/papr_scm: Update the NUMA distance table for the target node

2023-04-03 Thread Aneesh Kumar K.V
("powerpc/nvdimm: Pick nearby online node if the device node is not online") Signed-off-by: Aneesh Kumar K.V --- Changes from v1: * Update commit message * Update code comment arch/powerpc/mm/numa.c| 1 + arch/powerpc/platforms/pseries/papr_scm.c | 7 +++ 2 files

Re: [PATCH] powerpc/papr_scm: Update the NUMA distance table for the target node

2023-03-30 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > platform device helper routines won't update the NUMA distance table > while creating a platform device, even if the device is present on > a NUMA node that doesn't have memory or CPU. This is especially true > for pmem devices. If the target n

[PATCH] powerpc/papr_scm: Update the NUMA distance table for the target node

2023-03-30 Thread Aneesh Kumar K.V
node is not online") Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/papr_scm.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c index 2f8385523a13..5bef75714bd5 100644 --- a/ar

[RFC PATCH] fs/hugetlb: Fix UBSAN warning reported on hugetlb

2022-09-08 Thread Aneesh Kumar K.V
ells Cc: linux-fsde...@vger.kernel.org Cc: Al Viro Signed-off-by: Aneesh Kumar K.V --- fs/buffer.c| 6 +++--- fs/dax.c | 2 +- fs/iomap/buffered-io.c | 6 +++--- fs/iomap/direct-io.c | 2 +- include/linux/fs.h | 4 ++-- include/linux/stat.h | 2 +- mm/truncate.c | 2

[PATCH] powerpc/mm: Fix UBSAN warning reported on hugetlb

2022-09-08 Thread Aneesh Kumar K.V
03cde0] system_call_exception+0x250/0x600 [c0002ccb3e10] [c000c3bc] system_call_common+0xec/0x250 Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hugetlbpage.c | 6 +++--- mm/pagewalk.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/hugetlb

[PATCH] powerpc/mm/book3s/hash: Rename flush_tlb_pmd_range

2022-09-07 Thread Aneesh Kumar K.V
This function does the hash page table update. Hence rename it to indicate this better to avoid confusion with flush_pmd_tlb_range() Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/tlbflush-hash.h | 5 ++--- arch/powerpc/mm/book3s64/hash_pgtable.c| 2 +- arch

Re: [PATCH 2/2] powerpc/mm/64s: Drop p4d_leaf()

2022-09-04 Thread Aneesh Kumar K.V
age sizes supported at the P4D level. > > Therefore p4d_is_leaf() can never be true, so drop the definition and > fallback to the default implementation that always returns false. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Michael Ellerman > --- > arch/powerpc/include/asm/book3

Re: [PATCH 1/2] powerpc/mm/64s: Drop pgd_huge()

2022-09-04 Thread Aneesh Kumar K.V
t; base page size. > > Therefore there are no longer any supported configurations where > pgd_huge() can be true, so drop the definitions for pgd_huge(), and > fallback to the generic definition which is always false. > Reviewed-by: Aneesh Kumar K.V > Fixes: ba95b5d03596 ("po

Re: [RESEND PATCH 2/2] lib/nodemask: inline next_node_in() and node_random()

2022-08-11 Thread Aneesh Kumar K.V
Yury Norov writes: > The functions are pretty thin wrappers around find_bit engine, and > keeping them in c-file prevents compiler from small_const_nbits() > optimization, which must take place for all systems with MAX_NUMNODES > less than BITS_PER_LONG (default is 16 for me). > > Moving them to

[PATCH v2] mm/add_pages: Move Kconfig variable to mm/Kconfig

2022-07-04 Thread Aneesh Kumar K.V
No functional change in this patch. This was done so that the previous change (commit ac790d09885d ("powerpc/memhotplug: Add add_pages override for PPC")) can be easily backported. Cc: Michal Hocko Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/Kconfig | 5 + arch/x86/Kconf

[PATCH v2] powerpc/mm: Use is_vmalloc_addr to validate addr

2022-07-04 Thread Aneesh Kumar K.V
Instead of high_memory use is_vmalloc_addr to validate that the address is not in the vmalloc range. Cc: Kefeng Wang Cc: Christophe Leroy Signed-off-by: Aneesh Kumar K.V - --- arch/powerpc/include/asm/page.h | 10 -- arch/powerpc/mm/mem.c | 11 +++ 2 files changed

[PATCH v2] powerpc/mm: Update max/min_low_pfn in the same function

2022-07-04 Thread Aneesh Kumar K.V
For both CONFIG_NUMA enabled/disabled use mem_topology_setup to update max/min_low_pfn. This also add min_low_pfn update to CONFIG_NUMA which was initialized to zero before. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH v3] powerpc/memhotplug: Add add_pages override for PPC

2022-06-28 Thread Aneesh Kumar K.V
() for 64-bit Book3E & 32-bit") Cc: Kefeng Wang Cc: Christophe Leroy Signed-off-by: Aneesh Kumar K.V --- Changes from v2: * drop WARN_ON_ONCE * check for error from __add_pages arch/powerpc/Kconfig | 4 arch/powerpc/mm/mem.c | 33 - 2 files changed,

Re: [PATCH 1/2] powerpc/numa: Return the first online node instead of 0

2022-06-27 Thread Aneesh Kumar K.V
Srikar Dronamraju writes: > * Aneesh Kumar K.V [2022-06-23 18:24:41]: > >> If early cpu to node mapping finds an invalid node id, return >> the first online node instead of node 0. >> >> With commit e75130f20b1f ("powerpc/numa: Offline memoryless cpuless

[PATCH V2] powerpc/memhotplug: Add add_pages override for PPC

2022-06-27 Thread Aneesh Kumar K.V
() for 64-bit Book3E & 32-bit") Cc: Kefeng Wang Cc: Christophe Leroy Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/Kconfig | 4 arch/powerpc/mm/mem.c | 32 +++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Kconf

Re: [PATCH 3/3] powerpc/mm: Use VMALLOC_START to validate addr

2022-06-27 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Le 23/06/2022 à 14:29, Aneesh Kumar K.V a écrit : >> Instead of high_memory use VMALLOC_START to validate that the address is >> not in the vmalloc range. >> >> Cc: Kefeng Wang >> Cc: Christophe Leroy >> Signed-off-by: Ane

Re: [PATCH 2/2] powerpc/numa: Return the first online node if device tree mapping returns a not online node

2022-06-26 Thread Aneesh Kumar K.V
Srikar Dronamraju writes: > * Aneesh Kumar K.V [2022-06-23 18:24:42]: > >> While building the cpu_to_node map make sure we always use the online node >> to build the mapping table. In general this should not be an issue >> because the kernel use similar lookup mechanism

Re: [PATCH 3/3] powerpc/mm: Use VMALLOC_START to validate addr

2022-06-26 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Le 23/06/2022 à 14:29, Aneesh Kumar K.V a écrit : >> Instead of high_memory use VMALLOC_START to validate that the address is >> not in the vmalloc range. > > What's the reason for using VMALLOC_START instead ? > The gap between high_memory

Re: [PATCH 3/3] powerpc/mm: Use VMALLOC_START to validate addr

2022-06-26 Thread Aneesh Kumar K.V
Michael Ellerman writes: > "Aneesh Kumar K.V" writes: >> Instead of high_memory use VMALLOC_START to validate that the address is >> not in the vmalloc range. >> >> Cc: Kefeng Wang >> Cc: Christophe Leroy >> Signed-off-by: Aneesh Kumar K.

[PATCH 2/2] powerpc/numa: Return the first online node if device tree mapping returns a not online node

2022-06-23 Thread Aneesh Kumar K.V
in numa_setup_cpu() will always be found online. To keep logic simpler/correct, make sure that if the hypervisor or device tree returned a not online node, don't use that to build the map table. Instead, use the first_online_node. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 2 +- 1 file

[PATCH 1/2] powerpc/numa: Return the first online node instead of 0

2022-06-23 Thread Aneesh Kumar K.V
If early cpu to node mapping finds an invalid node id, return the first online node instead of node 0. With commit e75130f20b1f ("powerpc/numa: Offline memoryless cpuless node 0") the kernel marks node 0 offline in certain scenarios. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/i

[PATCH 3/3] powerpc/mm: Use VMALLOC_START to validate addr

2022-06-23 Thread Aneesh Kumar K.V
Instead of high_memory use VMALLOC_START to validate that the address is not in the vmalloc range. Cc: Kefeng Wang Cc: Christophe Leroy Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include

[PATCH 1/3] powerpc/memhotplug: Add add_pages override for PPC

2022-06-23 Thread Aneesh Kumar K.V
() for 64-bit Book3E & 32-bit") Cc: Kefeng Wang Cc: Christophe Leroy Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/Kconfig | 1 + arch/powerpc/mm/mem.c | 32 +++- arch/x86/Kconfig | 5 + mm/Kconfig| 3 +++ 4 files changed, 36 inse

[PATCH 2/3] powerpc/mm: Update max/min_low_pfn in the same function

2022-06-23 Thread Aneesh Kumar K.V
For both CONFIG_NUMA enabled/disabled use mem_topology_setup to update max/min_low_pfn. This also add min_low_pfn update to CONFIG_NUMA which was initialized to zero before. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

Re: [PATCH] powerpc/mm: Move CMA reservations after initmem_init()

2022-06-16 Thread Aneesh Kumar K.V
> CMA_MIN_ALIGNMENT_PAGES to fail. > > Fix it by moving the call to kvm_cma_reserve() after initmem_init(). The > pageblock_order is initialised in sparse_init() which is called from > initmem_init(). > > Also move the hugetlb CMA reservation. > Reviewed-by: Aneesh Kumar K.V >

[RFC PATCH] powerpc/numa: Return the first online node instead of 0

2022-05-23 Thread Aneesh Kumar K.V
If early cpu to node mapping finds an invalid node id, return the first online node instead of node 0. On ppc, we can find node 0 not present. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/topology.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc

[RFC PATCH] powerpc/numa: Return the first online node if device tree mapping returns a not online node

2022-05-23 Thread Aneesh Kumar K.V
numa_setup_cpu can return nodes that are not online. But setup_node_data() only initialize NODE_DATA for only online numa nodes. Hence avoid returning nodes that are not online. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] powerpc/papr_scm: Fix leaking nvdimm_events_map elements

2022-05-10 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Right now 'char *' elements allocated individual 'stat_id' in > 'papr_scm_priv.nvdimm_events_map' during papr_scm_pmu_check_events() leak in > papr_scm_remove() and papr_scm_pmu_register(), papr_scm_pmu_check_events() > error > paths. > > Also individual 'stat_id' arent

Re: [PATCH] pkeys: Make pkey unsigned in arch_set_user_pkey_access()

2022-03-06 Thread Aneesh Kumar K.V
(u16 pkey) > > Change the type of the pkey passed to arch_set_user_pkey_access() to u8. > > To: Dave Hansen > To: Michael Ellerman > Cc: Aneesh Kumar K.V > Signed-off-by: Ira Weiny > --- > arch/powerpc/include/asm/pkeys.h | 4 ++-- > arch/powerpc/mm/book3s64/pkey

Re: [RFC PATCH] KVM: PPC: Book3s HV: Allow setting GTSE for the nested guest

2022-03-06 Thread Aneesh Kumar K.V
Fabiano Rosas writes: > We're currently getting a Program Interrupt inside the nested guest > kernel when running with GTSE disabled in the nested hypervisor. We > allow any guest a cmdline override of GTSE for migration purposes. The > nested guest does not know it needs to use the option and

[PATCH v4 1/2] selftest/vm: Add util.h and and move helper functions there

2022-03-06 Thread Aneesh Kumar K.V
Avoid code duplication by adding util.h. No functional change in this patch. Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- Changes from v3: * rebased to linux-next-20220302 tools/testing/selftests/vm/ksm_tests.c| 38 +-- tools

[PATCH v4 2/2] selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT

2022-03-06 Thread Aneesh Kumar K.V
), (uintptr_t)ptr >> (PAGE_SHIFT - 3)) != sizeof(ent)) err(2, "read pagemap"); Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Mike Rapoport Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/gup_test.c | 3 ++- tools/test

[PATCH v3 2/2] selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT

2022-02-17 Thread Aneesh Kumar K.V
), (uintptr_t)ptr >> (PAGE_SHIFT - 3)) != sizeof(ent)) err(2, "read pagemap"); Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Mike Rapoport Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/gup_test.c | 3 ++- tools/test

[PATCH v3 1/2] selftest/vm: Add util.h and and move helper functions there

2022-02-17 Thread Aneesh Kumar K.V
Avoid code duplication by adding util.h. No functional change in this patch. Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/ksm_tests.c| 38 +-- tools/testing/selftests/vm/transhuge-stress.c | 42

[PATCH] selftest/vm: Fix map_fixed_noreplace test failure

2022-02-17 Thread Aneesh Kumar K.V
: Jann Horn Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- .../selftests/vm/map_fixed_noreplace.c| 49 ++- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/vm/map_fixed_noreplace.c b/tools

Re: [PATCH v2] powerpc/mm: Update default hugetlb size early

2022-02-11 Thread Aneesh Kumar K.V
Aneesh Kumar K.V writes: > David Hildenbrand writes: > >> On 11.02.22 10:16, Aneesh Kumar K V wrote: >>> On 2/11/22 14:00, David Hildenbrand wrote: >>>> On 11.02.22 07:52, Aneesh Kumar K.V wrote: >>>>> commit: d9c234005227 ("Do not depen

Re: [PATCH v2] powerpc/mm: Update default hugetlb size early

2022-02-11 Thread Aneesh Kumar K.V
David Hildenbrand writes: > On 11.02.22 10:16, Aneesh Kumar K V wrote: >> On 2/11/22 14:00, David Hildenbrand wrote: >>> On 11.02.22 07:52, Aneesh Kumar K.V wrote: >>>> commit: d9c234005227 ("Do not depend on MAX_ORDER when grouping pages by >>>> m

[PATCH v2] powerpc/mm: Update default hugetlb size early

2022-02-10 Thread Aneesh Kumar K.V
hould be 5 instead of 8. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/hugetlb.h | 5 - arch/powerpc/mm/book3s64/hugetlbpage.c | 2 +- arch/powerpc/mm/hugetlbpage.c | 5 + arch/powerpc/mm/init_64.c | 4 4 files changed, 10 insertions(+), 6

[PATCH v2 2/2] selftest/vm: Add util.h and and move helper functions there

2022-02-10 Thread Aneesh Kumar K.V
Avoid code duplication by adding util.h Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/ksm_tests.c| 45 +--- tools/testing/selftests/vm/transhuge-stress.c | 49 ++--- tools/testing/selftests/vm

[PATCH v2 1/2] selftest/vm: Use correct PAGE_SHIFT value for ppc64

2022-02-10 Thread Aneesh Kumar K.V
), (uintptr_t)ptr >> (PAGE_SHIFT - 3)) != sizeof(ent)) err(2, "read pagemap"); Cc: Shuah Khan Cc: linux-kselft...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/ksm_tests.c| 9 - tools/testing/selftests/vm/transh

[PATCH v2] mm/hugetlb: Fix kernel crash with hugetlb mremap

2022-02-10 Thread Aneesh Kumar K.V
a huge_pte_alloc. Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Cc: sta...@vger.kernel.org Reviewed-by: Mike Kravetz Reviewed-by: Mina Almasry Signed-off-by: Aneesh Kumar K.V --- mm/hugetlb.c | 7 +++ 1 file changed, 3 insertions(+), 4

Re: [PATCH] selftest/vm: Use correct PAGE_SHIFT value for ppc64

2022-02-09 Thread Aneesh Kumar K.V
Aneesh Kumar K.V writes: > Shuah Khan writes: > >> On 2/9/22 8:43 AM, Aneesh Kumar K.V wrote: >> --- a/tools/testing/selftests/vm/transhuge-stress.c >>> +++ b/tools/testing/selftests/vm/transhuge-stress.c >>> @@ -16,8 +16,16 @@ >>> #include >

Re: [PATCH] selftest/vm: Use correct PAGE_SHIFT value for ppc64

2022-02-09 Thread Aneesh Kumar K.V
Shuah Khan writes: > On 2/9/22 8:43 AM, Aneesh Kumar K.V wrote: >> Keep it simple by using a #define and limiting hugepage size to 2M. >> This keeps the test simpler instead of dynamically finding the page size >> and huge page size. >> >> Without this tests ar

[PATCH] selftest/vm: Use correct PAGE_SHIFT value for ppc64

2022-02-09 Thread Aneesh Kumar K.V
), (uintptr_t)ptr >> (PAGE_SHIFT - 3)) != sizeof(ent)) err(2, "read pagemap"); Cc: Shuah Khan Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/vm/ksm_tests.c| 8 tools/testing/selftests/vm/transhuge-stress.c | 8 2 files change

[PATCH] powerpc/mm: Update default hugetlb size early

2022-02-04 Thread Aneesh Kumar K.V
as HUGETLB_PAGE_ORDER (8) in the case of hash (16MB). With radix, HUGETLB_PAGE_ORDER will be 5 (2M size) and hence we would want pageblock_order to be 5 instead of 8. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/hugetlb.h | 5 - arch/powerpc/mm/book3s64/hugetlbpage.c | 2 +- arch/powerpc

Re: [PATCH] powerpc/64s/hash: Make hash faults work in NMI context

2022-02-03 Thread Aneesh Kumar K.V
low perf interrupts here but always do the > slowpath stack walk if we are in nmi context, but that slows down all > perf interrupt stack walking on hash though and it does not remove as > much tricky code. > Reviewed-by: Aneesh Kumar K.V > Cc: Aneesh Kumar K.V > Reported-by: L

Re: [PATCH v4] powerpc/papr_scm: Implement initial support for injecting smart errors

2022-02-02 Thread Aneesh Kumar K.V
the PDSM 'SMART_INJECT', papr_pdsm_smart_inject() > constructs a pair or 'inject_mask' and 'clear_mask' bitmaps from the payload > and bit-blt it to the 'health_bitmap_inject_mask'. This ensures the after > being > fetched from the hypervisor, the health_bitmap reflects requested smart-error > s

Re: [PATCH v7 1/7] powerpc/pmem: Restrict papr_scm to P8 and above.

2022-01-21 Thread Aneesh Kumar K.V
Michal Suchánek writes: > Hello, > > On Wed, Jul 01, 2020 at 12:52:29PM +0530, Aneesh Kumar K.V wrote: >> The PAPR based virtualized persistent memory devices are only supported on >> POWER9 and above. In the followup patch, the kernel will switch the >> persi

Re: [PATCH v7 3/7] powerpc/pmem: Add flush routines using new pmem store and sync instruction

2022-01-21 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Le 01/07/2020 à 09:22, Aneesh Kumar K.V a écrit : >> Start using dcbstps; phwsync; sequence for flushing persistent memory range. >> The new instructions are implemented as a variant of dcbf and hwsync and on >> P8 and P9 they will be executed as t

Re: [PATCH v3] powerpc/papr_scm: Implement initial support for injecting smart errors

2022-01-17 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Presently PAPR doesn't support injecting smart errors on an > NVDIMM. This makes testing the NVDIMM health reporting functionality > difficult as simulating NVDIMM health related events need a hacked up > qemu version. > > To solve this problem this patch proposes

Re: [PATCH] powerpc/pseries: Fix numa FORM2 parsing fallback code

2021-11-05 Thread Aneesh Kumar K.V
Nicholas Piggin writes: > In case the FORM2 distance table from firmware is not the expected size, > there is fallback code that just populates the lookup table as local vs > remote. > > However it then continues on to use the distance table. Fix. > Reviewed-by: Aneesh Kumar

Re: [PATCH 3/3] powerpc: Set crashkernel offset to mid of RMA region

2021-10-04 Thread Aneesh Kumar K.V
On 10/4/21 20:41, Sourabh Jain wrote: On large config LPARs (having 192 and more cores), Linux fails to boot due to insufficient memory in the first memory block. It is due to the reserve crashkernel area starts at 128MB offset by default and which doesn't leave enough space in the first memory

Re: [PATCH 1/3] fixup mmu_features immediately after getting cpu pa features.

2021-10-04 Thread Aneesh Kumar K.V
On 10/4/21 20:41, Sourabh Jain wrote: From: Mahesh Salgaonkar On system with radix support available, early_radix_enabled() starts returning true for a small window (until mmu_early_init_devtree() is called) even when radix mode disabled on kernel command line. This causes ppc64_bolted_size()

[PATCH] powerpc/doc: Fix htmldocs errors

2021-08-24 Thread Aneesh Kumar K.V
Fix make htmldocs related errors with the newly added associativity.rst doc file. Reported-by: Stephen Rothwell Signed-off-by: Aneesh Kumar K.V --- Documentation/powerpc/associativity.rst | 29 + Documentation/powerpc/index.rst | 1 + 2 files changed, 16

Re: linux-next: build warning after merge of the powerpc tree

2021-08-23 Thread Aneesh Kumar K.V
Stephen Rothwell writes: > Hi all, > > [cc'ing Jon in case he can fix the sphix hang - or knows anything about it] > > On Mon, 23 Aug 2021 19:55:40 +1000 Stephen Rothwell > wrote: >> >> After merging the powerpc tree, today's linux-next build (htmldocs) >> produced this warning: >> > > I

[PATCH v2 1/2] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-12 Thread Aneesh Kumar K.V
Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Also add a debugfs entry for tlb_local_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V --- Changes from v1: * switch to debugfs_create_u32 arch/powerpc/mm/book3s64/radix_tlb.c | 16 ++-- 1 file

[PATCH v2 2/2] powerpc: rename powerpc_debugfs_root to arch_debugfs_dir

2021-08-12 Thread Aneesh Kumar K.V
No functional change in this patch. arch_debugfs_dir is the generic kernel name declared in linux/debugfs.h for arch-specific debugfs directory. Architectures like x86/s390 already use the name. Rename powerpc specific powerpc_debugfs_root to arch_debugfs_dir. Signed-off-by: Aneesh Kumar K.V

[PATCH v8 5/5] powerpc/pseries: Add support for FORM2 associativity

2021-08-12 Thread Aneesh Kumar K.V
-off-by: Daniel Henrique Barboza Signed-off-by: Aneesh Kumar K.V --- Documentation/powerpc/associativity.rst | 104 arch/powerpc/include/asm/firmware.h | 3 +- arch/powerpc/include/asm/prom.h | 1 + arch/powerpc/kernel/prom_init.c | 3 +- arch/powerpc

[PATCH v8 4/5] powerpc/pseries: Add a helper for form1 cpu distance

2021-08-12 Thread Aneesh Kumar K.V
This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V

[PATCH v8 3/5] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-08-12 Thread Aneesh Kumar K.V
y provided by these device tree properties are very similar and hence can use a helper to parse the node id and numa distance details. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/topology.h | 2 + arch/powerpc/mm/numa.c| 212 +- arch/powerpc

[PATCH v8 2/5] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY

2021-08-12 Thread Aneesh Kumar K.V
Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 4 +-- arch/powerpc/include/asm/prom.h | 2 +- arch

[PATCH v8 1/5] powerpc/pseries: rename min_common_depth to primary_domain_index

2021-08-12 Thread Aneesh Kumar K.V
No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index

[PATCH v8 0/5] Add support for FORM2 associativity

2021-08-12 Thread Aneesh Kumar K.V
evice tree property for now because both Qemu nor PowerVM will provide the distance details of all possible NUMA nodes during boot. * Rework numa distance code based on review feedback. Changes from v3: * Drop PAPR SCM specific changes and depend completely on NUMA distance information. Ch

Re: [RFC PATCH] powerpc/book3s64/radix: Upgrade va tlbie to PID tlbie if we cross PMD_SIZE

2021-08-12 Thread Aneesh Kumar K.V
mmu()' into tlb flushing and memory freeing parts") This results in the kernel issuing a high number of TLB flushes even for a large range. This can be improved by making sure the kernel switch to pid based flush if the kernel is unmapping a 2M range. Signed-off-by: Aneesh Kumar K.V --- arch

Re: [PATCH] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-12 Thread Aneesh Kumar K.V
On 8/12/21 12:58 PM, Michael Ellerman wrote: Christophe Leroy writes: Le 10/08/2021 à 06:53, Aneesh Kumar K.V a écrit : Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_tlb.c | 48

Re: [PATCH v7 5/6] powerpc/pseries: Add support for FORM2 associativity

2021-08-11 Thread Aneesh Kumar K.V
On 8/12/21 7:11 AM, David Gibson wrote: On Wed, Aug 11, 2021 at 09:39:32AM +0530, Aneesh Kumar K.V wrote: David Gibson writes: On Mon, Aug 09, 2021 at 10:54:33AM +0530, Aneesh Kumar K.V wrote: PAPR interface currently supports two different ways of communicating resource grouping details

Re: [PATCH v7 5/6] powerpc/pseries: Add support for FORM2 associativity

2021-08-10 Thread Aneesh Kumar K.V
David Gibson writes: > On Mon, Aug 09, 2021 at 10:54:33AM +0530, Aneesh Kumar K.V wrote: >> PAPR interface currently supports two different ways of communicating >> resource >> grouping details to the OS. These are referred to as Form 0 and Form 1 >> associativity gr

[PATCH] powerpc: rename powerpc_debugfs_root to arch_debugfs_dir

2021-08-09 Thread Aneesh Kumar K.V
No functional change in this patch. arch_debugfs_dir is the generic kernel name declared in linux/debugfs.h for arch-specific debugfs directory. Architectures like x86/s390 already use the name. Rename powerpc specific powerpc_debugfs_root to arch_debugfs_dir. Signed-off-by: Aneesh Kumar K.V

[PATCH] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-09 Thread Aneesh Kumar K.V
Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_tlb.c | 48 1 file changed, 48 insertions(+) diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c b/arch/powerpc/mm

[PATCH v7 6/6] powerpc/pseries: Consolidate form1 distance initialization into a helper

2021-08-08 Thread Aneesh Kumar K.V
Currently, we duplicate parsing code for ibm,associativity and ibm,associativity-lookup-arrays in the kernel. The associativity array provided by these device tree properties are very similar and hence can use a helper to parse the node id and numa distance details. Signed-off-by: Aneesh Kumar

[PATCH v7 5/6] powerpc/pseries: Add support for FORM2 associativity

2021-08-08 Thread Aneesh Kumar K.V
-off-by: Daniel Henrique Barboza Signed-off-by: Aneesh Kumar K.V --- Documentation/powerpc/associativity.rst | 103 + arch/powerpc/include/asm/firmware.h | 3 +- arch/powerpc/include/asm/prom.h | 1 + arch/powerpc/kernel/prom_init.c | 3 +- arch

[PATCH v7 4/6] powerpc/pseries: Add a helper for form1 cpu distance

2021-08-08 Thread Aneesh Kumar K.V
This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V

[PATCH v7 3/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-08-08 Thread Aneesh Kumar K.V
de id from the associativity property, add helpers that can be used during boot which does this only once. Also remove the distance update from node id lookup helpers. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/topology.h | 2 + arch/powerpc/mm/numa.c

[PATCH v7 2/6] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY

2021-08-08 Thread Aneesh Kumar K.V
Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 4 +-- arch/powerpc/include/asm/prom.h | 2 +- arch

[PATCH v7 1/6] powerpc/pseries: rename min_common_depth to primary_domain_index

2021-08-08 Thread Aneesh Kumar K.V
No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index

[PATCH v7 0/6] Add support for FORM2 associativity

2021-08-08 Thread Aneesh Kumar K.V
istance details of all possible NUMA nodes during boot. * Rework numa distance code based on review feedback. Changes from v3: * Drop PAPR SCM specific changes and depend completely on NUMA distance information. Changes from v2: * Add nvdimm list to Cc: * update PATCH 8 commit message. Changes

Re: [PATCH v6 6/6] powerpc/pseries: Consolidate form1 distance initialization into a helper

2021-08-06 Thread Aneesh Kumar K.V
On 8/6/21 12:17 PM, David Gibson wrote: On Tue, Jul 27, 2021 at 03:33:11PM +0530, Aneesh Kumar K.V wrote: Currently, we duplicate parsing code for ibm,associativity and ibm,associativity-lookup-arrays in the kernel. The associativity array provided by these device tree properties are very

[RFC PATCH] powerpc/book3s64/radix: Upgrade va tlbie to PID tlbie if we cross PMD_SIZE

2021-08-03 Thread Aneesh Kumar K.V
igh number of TLB flushes even for a large range. This can be improved by making sure the kernel switch to pid based flush if the kernel is unmapping a 2M range. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_tlb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

[PATCH v6 4/6] powerpc/pseries: Add a helper for form1 cpu distance

2021-07-27 Thread Aneesh Kumar K.V
This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V

[PATCH v6 5/6] powerpc/pseries: Add support for FORM2 associativity

2021-07-27 Thread Aneesh Kumar K.V
-off-by: Daniel Henrique Barboza Signed-off-by: Aneesh Kumar K.V --- Documentation/powerpc/associativity.rst | 103 + arch/powerpc/include/asm/firmware.h | 3 +- arch/powerpc/include/asm/prom.h | 1 + arch/powerpc/kernel/prom_init.c | 3 +- arch

[PATCH v6 2/6] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY

2021-07-27 Thread Aneesh Kumar K.V
Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 4 +-- arch/powerpc/include/asm/prom.h | 2 +- arch

[PATCH v6 6/6] powerpc/pseries: Consolidate form1 distance initialization into a helper

2021-07-27 Thread Aneesh Kumar K.V
Currently, we duplicate parsing code for ibm,associativity and ibm,associativity-lookup-arrays in the kernel. The associativity array provided by these device tree properties are very similar and hence can use a helper to parse the node id and numa distance details. Signed-off-by: Aneesh Kumar

[PATCH v6 3/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-07-27 Thread Aneesh Kumar K.V
de id from the associativity property, add helpers that can be used during boot which does this only once. Also remove the distance update from node id lookup helpers. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/topology.h | 2 + arch/powerpc/mm/numa.c

<    1   2   3   4   5   6   7   8   9   10   >