[PATCH V5 0/3] arm64/mm/hotplug: Improve memory offline event notifier

2020-11-08 Thread Anshuman Khandual
: linux-kernel@vger.kernel.org Anshuman Khandual (3): arm64/mm/hotplug: Register boot memory hot remove notifier earlier arm64/mm/hotplug: Enable MEM_OFFLINE event handling arm64/mm/hotplug: Ensure early memory sections are all online arch/arm64/mm/mmu.c | 95

[PATCH V5 2/3] arm64/mm/hotplug: Enable MEM_OFFLINE event handling

2020-11-08 Thread Anshuman Khandual
-by: Gavin Shan Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 71dd9d753b8b..ca6d4952b733 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch

[PATCH V5 3/3] arm64/mm/hotplug: Ensure early memory sections are all online

2020-11-08 Thread Anshuman Khandual
the boot section scanning is selectively enabled with DEBUG_VM. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm

[PATCH V5 1/3] arm64/mm/hotplug: Register boot memory hot remove notifier earlier

2020-11-08 Thread Anshuman Khandual
: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Gavin Shan Reviewed-by: Catalin Marinas Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 13

Re: [PATCH] arm64: NUMA: Kconfig: Increase max number of nodes

2020-10-20 Thread Anshuman Khandual
On 10/20/2020 11:39 PM, Valentin Schneider wrote: > > Hi, > > Nit on the subject: this only increases the default, the max is still 2¹⁰. Agreed. > > On 20/10/20 18:34, Vanshidhar Konda wrote: >> The current arm64 max NUMA nodes default to 4. Today's arm64 systems can >> reach or exceed 16.

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-10-19 Thread Anshuman Khandual
On 10/07/2020 02:09 PM, David Hildenbrand wrote: >>> We do have __add_pages()->check_hotplug_memory_addressable() where we >>> already check against MAX_PHYSMEM_BITS. >> >> Initially, I thought about check_hotplug_memory_addressable() but the >> existing check that asserts end of hotplug wrt

Re: [PATCH 2/2] arm64: allow hotpluggable sections to be offlined

2020-10-19 Thread Anshuman Khandual
_memory_hotpluggable); > > This feels wrong. > >> Signed-off-by: Sudarshan Rajagopalan >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Anshuman Khandual >> Cc: Mark Rutland >> Cc: Gavin Shan >> Cc: Logan Gunthorpe >> Cc: David Hilde

Re: [PATCH 0/2] mm/memory_hotplug, arm64: allow certain bootmem sections to be offlinable

2020-10-19 Thread Anshuman Khandual
Hello Sudarshan, On 10/17/2020 07:32 AM, Sudarshan Rajagopalan wrote: > In the patch that enables memory hot-remove (commit bbd6ec605c0f ("arm64/mm: > Enable memory hot remove")) for arm64, there’s a notifier put in place that > prevents boot memory from being offlined and removed. The commit

Re: arm64: dropping prevent_bootmem_remove_notifier

2020-10-19 Thread Anshuman Khandual
On 10/17/2020 03:05 PM, David Hildenbrand wrote: > On 17.10.20 01:11, Sudarshan Rajagopalan wrote: >> >> Hello Anshuman, >> > David here, > > in general, if your driver offlines+removes random memory, it is doing > something *very* wrong and dangerous. You shouldn't ever be >

Re: arm64: dropping prevent_bootmem_remove_notifier

2020-10-18 Thread Anshuman Khandual
Hello Sudarshan, On 10/17/2020 04:41 AM, Sudarshan Rajagopalan wrote: > > Hello Anshuman, > > In the patch that enables memory hot-remove (commit bbd6ec605c0f ("arm64/mm: > Enable memory hot remove")) for arm64, there’s a notifier put in place that > prevents boot memory from being offlined

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-10-13 Thread Anshuman Khandual
On 10/12/2020 12:59 PM, Ard Biesheuvel wrote: > On Tue, 6 Oct 2020 at 08:36, Anshuman Khandual > wrote: >> >> >> >> On 09/30/2020 01:32 PM, Anshuman Khandual wrote: >>> But if __is_lm_address() checks against the effective linear range instead >>

Re: [PATCH v3] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-10-13 Thread Anshuman Khandual
cked > > Signed-off-by: Sudarshan Rajagopalan > Reviewed-by: Gavin Shan > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Anshuman Khandual > Cc: Mark Rutland > Cc: Logan Gunthorpe > Cc: David Hildenbrand > Cc: Andrew Morton > Cc: Steven Price Nonetheless, thi

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-10-06 Thread Anshuman Khandual
On 10/06/2020 09:04 PM, David Hildenbrand wrote: > On 17.09.20 10:46, Anshuman Khandual wrote: >> During memory hotplug process, the linear mapping should not be created for >> a given memory range if that would fall outside the maximum allowed linear >> range. Else

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-10-06 Thread Anshuman Khandual
On 09/30/2020 01:32 PM, Anshuman Khandual wrote: > But if __is_lm_address() checks against the effective linear range instead > i.e [_PAGE_OFFSET(vabits_actual)..(PAGE_END - 1)], it can be used for hot > plug physical range check there after. Perhaps something like this, though >

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-10-06 Thread Anshuman Khandual
On 09/30/2020 04:31 PM, Ard Biesheuvel wrote: > On Wed, 30 Sep 2020 at 10:03, Anshuman Khandual > wrote: >> >> >> On 09/29/2020 08:52 PM, Will Deacon wrote: >>> On Tue, Sep 29, 2020 at 01:34:24PM +0530, Anshuman Khandual wrote: >>>> >&g

Re: [PATCH v3] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-10-05 Thread Anshuman Khandual
epages(). > > Signed-off-by: Sudarshan Rajagopalan > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Anshuman Khandual > Cc: Mark Rutland > Cc: Logan Gunthorpe > Cc: David Hildenbrand > Cc: Andrew Morton > Cc: Steven Price > --- > arch/arm64/mm/mmu.c | 11 ++

Re: [PATCH V4 3/3] arm64/mm/hotplug: Ensure early memory sections are all online

2020-10-05 Thread Anshuman Khandual
On 10/01/2020 06:23 AM, Gavin Shan wrote: > Hi Anshuman, > > On 9/29/20 11:54 PM, Anshuman Khandual wrote: >> This adds a validation function that scans the entire boot memory and makes >> sure that all early memory sections are online. This check is essential for &

Re: [PATCH V4 2/3] arm64/mm/hotplug: Enable MEM_OFFLINE event handling

2020-10-05 Thread Anshuman Khandual
On 10/01/2020 05:27 AM, Gavin Shan wrote: > Hi Anshuman, > > On 9/29/20 11:54 PM, Anshuman Khandual wrote: >> This enables MEM_OFFLINE memory event handling. It will help intercept any >> possible error condition such as if boot memory some how still got offlined >

Re: [RFC V2] mm/vmstat: Add events for HugeTLB migration

2020-10-05 Thread Anshuman Khandual
On 10/05/2020 11:35 AM, Michal Hocko wrote: > On Mon 05-10-20 07:59:12, Anshuman Khandual wrote: >> >> >> On 10/02/2020 05:34 PM, Michal Hocko wrote: >>> On Wed 30-09-20 11:30:49, Anshuman Khandual wrote: >>>> Add following new vmstat events which will

Re: [RFC V2] mm/vmstat: Add events for HugeTLB migration

2020-10-04 Thread Anshuman Khandual
On 10/02/2020 05:34 PM, Michal Hocko wrote: > On Wed 30-09-20 11:30:49, Anshuman Khandual wrote: >> Add following new vmstat events which will track HugeTLB page migration. >> >> 1. HUGETLB_MIGRATION_SUCCESS >> 2. HUGETLB_MIGRATION_FAILURE >> >> It follow

Re: [PATCH v2] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-09-30 Thread Anshuman Khandual
epages(). > > Signed-off-by: Sudarshan Rajagopalan > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Anshuman Khandual > Cc: Mark Rutland > Cc: Logan Gunthorpe > Cc: David Hildenbrand > Cc: Andrew Morton > Cc: Steven Price > --- > arch/arm64/mm/mmu.c |

Re: [RFC V2] mm/vmstat: Add events for HugeTLB migration

2020-09-30 Thread Anshuman Khandual
On 09/30/2020 01:16 PM, Oscar Salvador wrote: > On Wed, Sep 30, 2020 at 11:30:49AM +0530, Anshuman Khandual wrote: >> -is_thp = PageTransHuge(page) && !PageHuge(page); >> -nr_subpages = thp_nr_pages(page); >> +

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-09-30 Thread Anshuman Khandual
On 09/29/2020 08:52 PM, Will Deacon wrote: > On Tue, Sep 29, 2020 at 01:34:24PM +0530, Anshuman Khandual wrote: >> >> >> On 09/29/2020 02:05 AM, Will Deacon wrote: >>> On Thu, Sep 17, 2020 at 02:16:42PM +0530, Anshuman Khandual wrote: >>>> During memory

[RFC V2] mm/vmstat: Add events for HugeTLB migration

2020-09-30 Thread Anshuman Khandual
' to accommodate now available HugeTLB based statistics. Cc: Daniel Jordan Cc: Zi Yan Cc: John Hubbard Cc: Mike Kravetz Cc: Oscar Salvador Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- Applies on linux-next and v5.9-rc7

[PATCH V4 2/3] arm64/mm/hotplug: Enable MEM_OFFLINE event handling

2020-09-29 Thread Anshuman Khandual
-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 4e70f4fea06c..90a30f5ebfc0 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1482,13

[PATCH V4 1/3] arm64/mm/hotplug: Register boot memory hot remove notifier earlier

2020-09-29 Thread Anshuman Khandual
: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Gavin Shan Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 13 +++-- 1 file changed

[PATCH V4 3/3] arm64/mm/hotplug: Ensure early memory sections are all online

2020-09-29 Thread Anshuman Khandual
: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 59 + 1 file changed, 59 insertions(+) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 90a30f5ebfc0..b67a657ea1ad 100644 --- a/arch/arm64/mm/mmu.c +++ b

[PATCH V4 0/3] arm64/mm/hotplug: Improve memory offline event notifier

2020-09-29 Thread Anshuman Khandual
: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: Gavin Shan Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (3): arm64/mm/hotplug: Register boot memory hot remove notifier earlier arm64/mm/hotplug

Re: [PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-09-29 Thread Anshuman Khandual
On 09/29/2020 02:05 AM, Will Deacon wrote: > On Thu, Sep 17, 2020 at 02:16:42PM +0530, Anshuman Khandual wrote: >> During memory hotplug process, the linear mapping should not be created for >> a given memory range if that would fall outside the maximum allowed linear >>

Re: [RFC] mm/vmstat: Add events for HugeTLB migration

2020-09-29 Thread Anshuman Khandual
On 09/29/2020 03:34 AM, Mike Kravetz wrote: > On 9/25/20 2:12 AM, Anshuman Khandual wrote: >> Add following new vmstat events which will track HugeTLB page migration. >> >> 1. HUGETLB_MIGRATION_SUCCESS >> 2. HUGETLB_MIGRATION_FAILURE >> >> It follow

Re: [RFC] mm/vmstat: Add events for HugeTLB migration

2020-09-27 Thread Anshuman Khandual
On 09/25/2020 03:19 PM, Oscar Salvador wrote: > On Fri, Sep 25, 2020 at 02:42:29PM +0530, Anshuman Khandual wrote: >> Add following new vmstat events which will track HugeTLB page migration. >> >> 1. HUGETLB_MIGRATION_SUCCESS >> 2. HUGETLB_MIGRATION_FAILURE &g

[RFC] mm/vmstat: Add events for HugeTLB migration

2020-09-25 Thread Anshuman Khandual
pages" to accommodate now available HugeTLB based statistics. Cc: Daniel Jordan Cc: Zi Yan Cc: John Hubbard Cc: Mike Kravetz Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This is just for getting some early feedbacks. Applie

Re: [PATCH V3 2/3] arm64/mm/hotplug: Enable MEM_OFFLINE event handling

2020-09-23 Thread Anshuman Khandual
On 09/23/2020 12:01 PM, Gavin Shan wrote: > Hi Anshuman, > > On 9/21/20 10:05 PM, Anshuman Khandual wrote: >> This enables MEM_OFFLINE memory event handling. It will help intercept any >> possible error condition such as if boot memory some how still got offlined >

Re: [PATCH V3 1/3] arm64/mm/hotplug: Register boot memory hot remove notifier earlier

2020-09-23 Thread Anshuman Khandual
On 09/23/2020 11:34 AM, Gavin Shan wrote: > Hi Anshuman, > > On 9/21/20 10:05 PM, Anshuman Khandual wrote: >> This moves memory notifier registration earlier in the boot process from >> device_initcall() to early_initcall() which will help in guarding against >>

[PATCH] mm/debug_vm_pgtable: Drop hugetlb_advanced_tests()

2020-09-23 Thread Anshuman Khandual
-by: Anshuman Khandual --- This applies on current linux-next (20200923). mm/debug_vm_pgtable.c | 55 --- 1 file changed, 55 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index b0edca2e2c73..c5ae822cc6bc 100644 --- a/mm

Re: [PATCH V3 2/3] arm64/mm/hotplug: Enable MEM_OFFLINE event handling

2020-09-22 Thread Anshuman Khandual
On 09/21/2020 05:35 PM, Anshuman Khandual wrote: > This enables MEM_OFFLINE memory event handling. It will help intercept any > possible error condition such as if boot memory some how still got offlined > even after an explicit notifier failure, potentially by a future change in >

Re: [mm/debug_vm_pgtable/locks] e2aad6f1d2: BUG:unable_to_handle_page_fault_for_address

2020-09-22 Thread Anshuman Khandual
On 09/22/2020 02:50 PM, Aneesh Kumar K.V wrote: > On 9/22/20 2:22 PM, Anshuman Khandual wrote: >> >> >> On 09/22/2020 09:33 AM, Aneesh Kumar K.V wrote: >>> On 9/21/20 2:51 PM, kernel test robot wrote: >>>> Greeting, >>>> >&

Re: [mm/debug_vm_pgtable/locks] e2aad6f1d2: BUG:unable_to_handle_page_fault_for_address

2020-09-22 Thread Anshuman Khandual
On 09/22/2020 09:33 AM, Aneesh Kumar K.V wrote: > On 9/21/20 2:51 PM, kernel test robot wrote: >> Greeting, >> >> FYI, we noticed the following commit (built with gcc-9): >> >> commit: e2aad6f1d232b457ea6a3194992dd4c0a83534a5 >> ("mm/debug_vm_pgtable/locks: take correct page table lock") >>

Re: [PATCH 2/2] arm64/mm: Enable color zero pages

2020-09-21 Thread Anshuman Khandual
On 09/21/2020 08:26 AM, Gavin Shan wrote: > Hi Robin, > > On 9/17/20 8:22 PM, Robin Murphy wrote: >> On 2020-09-17 04:35, Gavin Shan wrote: >>> On 9/16/20 6:28 PM, Will Deacon wrote: On Wed, Sep 16, 2020 at 01:25:23PM +1000, Gavin Shan wrote: > This enables color zero pages by

[PATCH V3 0/3] arm64/mm/hotplug: Improve memory offline event notifier

2020-09-21 Thread Anshuman Khandual
: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (3): arm64/mm/hotplug: Register boot memory hot remove notifier earlier arm64/mm/hotplug: Enable MEM_OFFLINE event

[PATCH V3 2/3] arm64/mm/hotplug: Enable MEM_OFFLINE event handling

2020-09-21 Thread Anshuman Khandual
and help debug further. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 37

[PATCH V3 1/3] arm64/mm/hotplug: Register boot memory hot remove notifier earlier

2020-09-21 Thread Anshuman Khandual
: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Steve Capper Cc: Mark Brown Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 14 -- 1 file changed, 12 insertions(+), 2

[PATCH V3 3/3] arm64/mm/hotplug: Ensure early memory sections are all online

2020-09-21 Thread Anshuman Khandual
: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 59 + 1 file changed, 59 insertions(+) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6b171bd88bcf..124eeb84ec43 100644 --- a/arch/arm64/mm/mmu.c +++ b

Re: [PATCH v2] mm/migrate: correct thp migration stats.

2020-09-17 Thread Anshuman Khandual
t; + > nr_thp_failed++; > nr_failed += nr_subpages; > goto out; > Moving the failure path inside the split path makes sense, now that it is already established that the page is indeed a THP. Reviewed-by: Anshuman Khandual

[PATCH] arm64/mm: Validate hotplug range before creating linear mapping

2020-09-17 Thread Anshuman Khandual
Signed-off-by: Anshuman Khandual --- arch/arm64/mm/mmu.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 75df62fea1b6..d59ffabb9c84 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1433,11 +1433,38 @@ s

Re: [PATCH v2] arm64/mm: Refactor {pgd, pud, pmd, pte}_ERROR()

2020-09-14 Thread Anshuman Khandual
) > -{ > - pr_err("%s:%d: bad pmd %016lx.\n", file, line, val); > -} > - > -void __pud_error(const char *file, int line, unsigned long val) > -{ > - pr_err("%s:%d: bad pud %016lx.\n", file, line, val); > -} > - > -void __pgd_error(const char *file, int line, unsigned long val) > -{ > - pr_err("%s:%d: bad pgd %016lx.\n", file, line, val); > -} > - > /* GENERIC_BUG traps */ > > int is_valid_bugaddr(unsigned long addr) > Looks good to me. Seems like a sensible clean up which reduces code. Tried booting on multiple page size configs and see no regression. Reviewed-by: Anshuman Khandual

Re: [PATCH v2] arm64/mm: Refactor {pgd, pud, pmd, pte}_ERROR()

2020-09-13 Thread Anshuman Khandual
On 09/14/2020 05:17 AM, Gavin Shan wrote: > The function __{pgd, pud, pmd, pte}_error() are introduced so that > they can be called by {pgd, pud, pmd, pte}_ERROR(). However, some > of the functions could never be called when the corresponding page > table level isn't enabled. For example,

Re: [PATCH V2] arm64/hotplug: Improve memory offline event notifier

2020-09-13 Thread Anshuman Khandual
On 09/11/2020 07:36 PM, Catalin Marinas wrote: > Hi Anshuman, > > On Mon, Aug 24, 2020 at 09:34:29AM +0530, Anshuman Khandual wrote: >> This brings about three different changes to the sole memory event notifier >> for arm64 platform and improves it's robustness while

Re: [PATCH v2 3/3] arm64/mm: Unitify CONT_PMD_SHIFT

2020-09-11 Thread Anshuman Khandual
s new configuration ARM64_CONT_PMD_SHIFT makes sense, as it eliminates existing constant values that are used in an ad hoc manner, while computing contiguous page table entry properties. Reviewed-by: Anshuman Khandual

Re: [PATCH v2 2/3] arm64/mm: Unitify CONT_PTE_SHIFT

2020-09-11 Thread Anshuman Khandual
AGES) > -#define CONT_PTE_SHIFT (7 + PAGE_SHIFT) > #define CONT_PMD_SHIFT (5 + PMD_SHIFT) > #else > -#define CONT_PTE_SHIFT (4 + PAGE_SHIFT) > #define CONT_PMD_SHIFT (4 + PMD_SHIFT) > #endif > > Looks good to me and there are no obvious regressions as well. Reviewed-by: Anshuman Khandual

Re: [PATCH] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-09-10 Thread Anshuman Khandual
mory hot-add as best as possible. Understood, seems like there is enough potential use cases and scenarios right now, to consider this fallback mechanism and a possible mixed page size vmemmap. But I would let others weigh in, on the performance impact. > > Thanks and Regards,

Re: [PATCH] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-09-10 Thread Anshuman Khandual
On 09/10/2020 01:38 PM, David Hildenbrand wrote: > On 10.09.20 08:45, Anshuman Khandual wrote: >> Hello Sudarshan, >> >> On 09/10/2020 11:35 AM, Sudarshan Rajagopalan wrote: >>> When section mappings are enabled, we allocate vmemmap pages from physically >>

Re: [PATCH] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-09-10 Thread Anshuman Khandual
ack option to allocate vmemmap pages >> from >> discontinuous pages using vmemmap_populate_basepages(). >> >> Signed-off-by: Sudarshan Rajagopalan >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Anshuman Khandual >> Cc: Mark Rutland >> Cc: Logan Guntho

Re: [PATCH 2/2] arm64/mm: Use CONT_SHIFT to define CONT_PTE_SHIFT

2020-09-10 Thread Anshuman Khandual
On 09/10/2020 02:01 PM, Gavin Shan wrote: > Hi Anshuman, > > On 9/10/20 4:17 PM, Anshuman Khandual wrote: >> On 09/08/2020 12:49 PM, Gavin Shan wrote: >>> The macro CONT_PTE_SHIFT actually depends on CONT_SHIFT, which has >>> been defined in page-def.h, based

Re: [PATCH] arm64/mm: add fallback option to allocate virtually contiguous memory

2020-09-10 Thread Anshuman Khandual
to kernel ? > > Signed-off-by: Sudarshan Rajagopalan > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Anshuman Khandual > Cc: Mark Rutland > Cc: Logan Gunthorpe > Cc: David Hildenbrand > Cc: Andrew Morton > Cc: Steven Price > --- > arch/arm64/mm/mmu.c

Re: [PATCH 2/2] arm64/mm: Use CONT_SHIFT to define CONT_PTE_SHIFT

2020-09-10 Thread Anshuman Khandual
On 09/08/2020 12:49 PM, Gavin Shan wrote: > The macro CONT_PTE_SHIFT actually depends on CONT_SHIFT, which has > been defined in page-def.h, based on CONFIG_ARM64_CONT_SHIFT. Lets > reflect the dependency. > > Signed-off-by: Gavin Shan > --- > arch/arm64/include/asm/pgtable-hwdef.h | 4 +---

Re: [PATCH 1/2] arm64/mm: Remove CONT_RANGE_OFFSET

2020-09-10 Thread Anshuman Khandual
_PMD_SHIFT - PMD_SHIFT)) > #define CONT_PMD_SIZE(CONT_PMDS * PMD_SIZE) > #define CONT_PMD_MASK(~(CONT_PMD_SIZE - 1)) > -/* the numerical offset of the PTE within a range of CONT_PTES */ > -#define CONT_RANGE_OFFSET(addr) (((addr)>>PAGE_SHIFT)&(CONT_PTES-1)) > > /* > * Hardware page table definitions. > Reviewed-by: Anshuman Khandual

[PATCH V4] arm64/cpuinfo: Define HWCAP name arrays per their actual bit definitions

2020-09-08 Thread Anshuman Khandual
Cc: Ard Biesheuvel Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on 5.9-rc4 Mark, since the patch has changed I have dropped your Acked-by: tag. Are you happy to give a new one

[PATCH V2 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-09-08 Thread Anshuman Khandual
ad.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Catalin Marinas Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/pgtable-prot.h | 7 ++ arch/arm64/include/asm/pgtable.h | 34 --- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/a

[PATCH V2 0/2] arm64/mm: Enable THP migration

2020-09-08 Thread Anshuman Khandual
PMD state per Catalin Changes in RFC V1: (https://patchwork.kernel.org/project/linux-mm/list/?series=138797) Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Suzuki Poulose Cc: Zi Yan Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman

[PATCH V2 2/2] arm64/mm: Enable THP migration

2020-09-08 Thread Anshuman Khandual
: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Suzuki Poulose Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Catalin Marinas Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 4 arch/arm64/include/asm/pgtable.h | 5 + 2

Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-09-08 Thread Anshuman Khandual
On 09/03/2020 11:01 PM, Ralph Campbell wrote: > > On 9/3/20 9:56 AM, Catalin Marinas wrote: >> On Mon, Aug 17, 2020 at 02:49:43PM +0530, Anshuman Khandual wrote: >>> pmd_present() and pmd_trans_huge() are expected to behave in the following >>> manner during

Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-09-08 Thread Anshuman Khandual
On 09/03/2020 10:26 PM, Catalin Marinas wrote: > On Mon, Aug 17, 2020 at 02:49:43PM +0530, Anshuman Khandual wrote: >> pmd_present() and pmd_trans_huge() are expected to behave in the following >> manner during various phases of a given PMD. It is derived from a previous >>

Re: [PATCH V2] arm64/hotplug: Improve memory offline event notifier

2020-09-08 Thread Anshuman Khandual
On 08/24/2020 09:34 AM, Anshuman Khandual wrote: > This brings about three different changes to the sole memory event notifier > for arm64 platform and improves it's robustness while also enhancing debug > capabilities during potential memory offlining error conditions. >

Re: [PATCH V3] arm64/cpuinfo: Define HWCAP name arrays per their actual bit definitions

2020-09-08 Thread Anshuman Khandual
On 09/08/2020 01:11 PM, Will Deacon wrote: > On Tue, Sep 08, 2020 at 10:43:12AM +0530, Anshuman Khandual wrote: >> >> >> On 09/07/2020 05:46 PM, Will Deacon wrote: >>> On Mon, Aug 17, 2020 at 05:34:23PM +0530, Anshuman Khandual wrote: >>>> HWCA

Re: [PATCH V3] arm64/cpuinfo: Define HWCAP name arrays per their actual bit definitions

2020-09-07 Thread Anshuman Khandual
On 09/07/2020 05:46 PM, Will Deacon wrote: > On Mon, Aug 17, 2020 at 05:34:23PM +0530, Anshuman Khandual wrote: >> HWCAP name arrays (hwcap_str, compat_hwcap_str, compat_hwcap2_str) that are >> scanned for /proc/cpuinfo are detached from their bit definitions making i

[PATCH] arm64/mm/ptdump: Add address markers for BPF regions

2020-09-04 Thread Anshuman Khandual
ambiguous, as arch/arm64/mm/ptdump.c instead. Cc: Catalin Marinas Cc: Will Deacon Cc: Ard Biesheuvel Cc: Steven Price Cc: Andrew Morton Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/Makefile | 2 +- arch/arm64

Re: Warning on Kernel 5.9.0-rc1 on PowerBook G4 (ppc32), bisected to a5c3b9ffb0f4

2020-08-31 Thread Anshuman Khandual
modification turns the warning statements into BUGS. These warnings are from mm/debug_vm_pgtable.c test, wont be converted into BUGS. But nonetheless, need to be addressed though. > > The problem was bisected to commit a5c3b9ffb0f4 ("mm/debug_vm_pgtable: add > tests validating a

Re: [PATCH V2] arm64/hotplug: Improve memory offline event notifier

2020-08-23 Thread Anshuman Khandual
On 08/24/2020 09:34 AM, Anshuman Khandual wrote: > This brings about three different changes to the sole memory event notifier > for arm64 platform and improves it's robustness while also enhancing debug > capabilities during potential memory offlining error conditions. >

[PATCH V2] arm64/hotplug: Improve memory offline event notifier

2020-08-23 Thread Anshuman Khandual
...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on 5.9-rc2 Changes in V2: - Dropped all generic changes wrt MEM_CANCEL_OFFLINE reasons enumeration - Dropped all related (processing MEM_CANCEL_OFFLINE reasons) changes on arm64 - Added

Re: [RFC/RFT PATCH 1/6] numa: Move numa implementation to common code

2020-08-19 Thread Anshuman Khandual
On 08/20/2020 12:48 AM, Atish Patra wrote: > On Tue, Aug 18, 2020 at 8:19 PM Anshuman Khandual > wrote: >> >> >> >> On 08/15/2020 03:17 AM, Atish Patra wrote: >>> ARM64 numa implementation is generic enough that RISC-V can reuse that >>>

Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-08-19 Thread Anshuman Khandual
On 08/18/2020 05:56 PM, Jonathan Cameron wrote: > On Tue, 18 Aug 2020 15:11:58 +0530 > Anshuman Khandual wrote: > >> On 08/18/2020 02:43 PM, Jonathan Cameron wrote: >>> On Mon, 17 Aug 2020 14:49:43 +0530 >>> Anshuman Khandual wrote: >>> >>&g

Re: [PATCH] mm: Fix missing function declaration

2020-08-19 Thread Anshuman Khandual
[-Wmissing-prototypes] > 15 | void rodata_test(void) > | ^~~ > > Fixes: 2959a5f726f6 ("mm: add arch-independent testcases for RODATA") > Signed-off-by: Leon Romanovsky This build failure appears only with W=1 and gets fixed with this. Reviewed-by: Ans

Re: [PATCH v2 2/2] mm/pageblock: remove false sharing in pageblock_flags

2020-08-19 Thread Anshuman Khandual
On 08/19/2020 11:17 AM, Alex Shi wrote: > Current pageblock_flags is only 4 bits, so it has to share a char size > in cmpxchg when get set, the false sharing cause perf drop. > > If we incrase the bits up to 8, false sharing would gone in cmpxchg. and > the only cost is half char per

Re: [PATCH v2 1/2] mm/pageblock: mitigation cmpxchg false sharing in pageblock flags

2020-08-19 Thread Anshuman Khandual
On 08/19/2020 11:17 AM, Alex Shi wrote: > pageblock_flags is used as long, since every pageblock_flags is just 4 > bits, 'long' size will include 8(32bit machine) or 16 pageblocks' flags, > that flag setting has to sync in cmpxchg with 7 or 15 other pageblock > flags. It would cause long

Re: [RFC/RFT PATCH 1/6] numa: Move numa implementation to common code

2020-08-18 Thread Anshuman Khandual
On 08/15/2020 03:17 AM, Atish Patra wrote: > ARM64 numa implementation is generic enough that RISC-V can reuse that > implementation with very minor cosmetic changes. This will help both > ARM64 and RISC-V in terms of maintanace and feature improvement > > Move the numa implementation code to

Re: [PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-08-18 Thread Anshuman Khandual
On 08/18/2020 02:43 PM, Jonathan Cameron wrote: > On Mon, 17 Aug 2020 14:49:43 +0530 > Anshuman Khandual wrote: > >> pmd_present() and pmd_trans_huge() are expected to behave in the following >> manner during various phases of a given PMD. It is derived from a previous &

Re: [PATCH] mm/hotplug: Enumerate memory range offlining failure reasons

2020-08-18 Thread Anshuman Khandual
On 08/18/2020 11:35 AM, Michal Hocko wrote: > On Tue 18-08-20 09:52:02, Anshuman Khandual wrote: >> Currently a debug message is printed describing the reason for memory range >> offline failure. This just enumerates existing reason codes which improves >> overall

[PATCH] mm/hotplug: Enumerate memory range offlining failure reasons

2020-08-17 Thread Anshuman Khandual
: Dan Williams Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This is based on 5.9-rc1 include/linux/memory.h | 28 mm/memory_hotplug.c| 18 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff

[PATCH V3] arm64/cpuinfo: Define HWCAP name arrays per their actual bit definitions

2020-08-17 Thread Anshuman Khandual
Cc: Ard Biesheuvel Cc: Mark Rutland Cc: Suzuki K Poulose Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on 5.9-rc1 Mark, since the patch has changed I have dropped your Acked-by: tag. Are you happy to give a new one

[PATCH 2/2] arm64/mm: Enable THP migration

2020-08-17 Thread Anshuman Khandual
Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Suzuki Poulose Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 4 arch/arm64/include/asm/pgtable.h | 5 + 2 files changed, 9

[PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

2020-08-17 Thread Anshuman Khandual
x-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/pgtable-prot.h | 7 ++ arch/arm64/include/asm/pgtable.h | 34 --- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/arch/arm64/in

[PATCH 0/2] arm64/mm: Enable THP migration

2020-08-17 Thread Anshuman Khandual
in RFC V1: (https://patchwork.kernel.org/project/linux-mm/list/?series=138797) Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Suzuki Poulose Cc: Zi Yan Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): arm64/mm: Change

Re: [RFC V2 1/2] arm64/mm: Change THP helpers per generic memory semantics

2020-08-16 Thread Anshuman Khandual
On 07/07/2020 11:14 PM, Catalin Marinas wrote: > On Mon, Jul 06, 2020 at 09:27:04AM +0530, Anshuman Khandual wrote: >> On 07/02/2020 05:41 PM, Catalin Marinas wrote: >>> On Mon, Jun 15, 2020 at 06:45:17PM +0530, Anshuman Khandual wrote: >>>> --- a/arch/arm64/in

Re: [PATCH -next] arm64: Export __cpu_logical_map

2020-07-24 Thread Anshuman Khandual
On 07/24/2020 03:00 PM, Catalin Marinas wrote: > On Fri, Jul 24, 2020 at 01:46:18PM +0530, Anshuman Khandual wrote: >> On 07/24/2020 08:38 AM, Kefeng Wang wrote: >>> On 2020/7/24 11:04, Kefeng Wang wrote: >>>> ERROR: modpost: "__cpu_logical_map&qu

Re: [PATCH -next] arm64: Export __cpu_logical_map

2020-07-24 Thread Anshuman Khandual
On 07/24/2020 03:05 PM, Catalin Marinas wrote: > On Fri, Jul 24, 2020 at 10:13:52AM +0100, Mark Rutland wrote: >> On Fri, Jul 24, 2020 at 01:46:18PM +0530, Anshuman Khandual wrote: >>> On 07/24/2020 08:38 AM, Kefeng Wang wrote: >>>>> Reported-by: Hulk Robot

Re: [PATCH -next] arm64: Export __cpu_logical_map

2020-07-24 Thread Anshuman Khandual
On 07/24/2020 08:38 AM, Kefeng Wang wrote: > +maillist This does not seem to be a correct method of posting any patch. > > On 2020/7/24 11:04, Kefeng Wang wrote: >> ERROR: modpost: "__cpu_logical_map" [drivers/cpufreq/tegra194-cpufreq.ko] >> undefined! >> >> ARM64 tegra194-cpufreq driver

Re: [PATCH v2 2/4] mm/hugetlb.c: Remove the unnecessary non_swap_entry()

2020-07-23 Thread Anshuman Khandual
On 07/23/2020 11:44 AM, Baoquan He wrote: > On 07/23/20 at 10:36am, Anshuman Khandual wrote: >> >> >> On 07/23/2020 08:52 AM, Baoquan He wrote: >>> The checking is_migration_entry() and is_hwpoison_entry() are stricter >>> than non_swap_entry(), means

Re: [PATCH v2 4/4] mm/hugetl.c: warn out if expected count of huge pages adjustment is not achieved

2020-07-23 Thread Anshuman Khandual
On 07/23/2020 08:52 AM, Baoquan He wrote: > A customer complained that no message is logged when the number of > persistent huge pages is not changed to the exact value written to > the sysfs or proc nr_hugepages file. > > In the current code, a best effort is made to satisfy requests made

Re: [PATCH v2 3/4] doc/vm: fix typo in the hugetlb admin documentation

2020-07-22 Thread Anshuman Khandual
On 07/23/2020 08:52 AM, Baoquan He wrote: > Change 'pecify' to 'Specify'. > > Signed-off-by: Baoquan He > Reviewed-by: Mike Kravetz > Reviewed-by: David Hildenbrand > --- > Documentation/admin-guide/mm/hugetlbpage.rst | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH v2 2/4] mm/hugetlb.c: Remove the unnecessary non_swap_entry()

2020-07-22 Thread Anshuman Khandual
t; else > return false; > It would be better if the commit message contains details about the existing redundant check. But either way. Reviewed-by: Anshuman Khandual

Re: [PATCH v2 1/4] mm/hugetlb.c: make is_hugetlb_entry_hwpoisoned return bool

2020-07-22 Thread Anshuman Khandual
if (non_swap_entry(swp) && is_hwpoison_entry(swp)) > - return 1; > + return true; > else > - return 0; > + return false; > } > > int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, > Reviewed-by: Anshuman Khandual

Re: [PATCH] arm64: mm: free unused memmap for sparse memory model that define VMEMMAP

2020-07-22 Thread Anshuman Khandual
On 07/21/2020 01:02 PM, Wei Li wrote: > For the memory hole, sparse memory model that define SPARSEMEM_VMEMMAP > do not free the reserved memory for the page map, this patch do it. > > Signed-off-by: Wei Li > Signed-off-by: Chen Feng > Signed-off-by: Xia Qing > --- > arch/arm64/mm/init.c |

Re: [PATCH v3] mm/hugetlb: split hugetlb_cma in nodes with memory

2020-07-20 Thread Anshuman Khandual
On 07/17/2020 10:32 PM, Mike Kravetz wrote: > On 7/16/20 10:02 PM, Anshuman Khandual wrote: >> >> >> On 07/16/2020 11:55 PM, Mike Kravetz wrote: >>> >From 17c8f37afbf42fe7412e6eebb3619c6e0b7e1c3c Mon Sep 17 00:00:00 2001 >>> From: Mike Kravetz

Re: [PATCH v3] mm/hugetlb: split hugetlb_cma in nodes with memory

2020-07-20 Thread Anshuman Khandual
On 07/17/2020 11:07 PM, Mike Kravetz wrote: > On 7/17/20 2:51 AM, Anshuman Khandual wrote: >> >> >> On 07/17/2020 02:06 PM, Will Deacon wrote: >>> On Fri, Jul 17, 2020 at 10:32:53AM +0530, Anshuman Khandual wrote: >>>> >>>> >&g

Re: [PATCH v3] mm/hugetlb: split hugetlb_cma in nodes with memory

2020-07-17 Thread Anshuman Khandual
On 07/17/2020 02:06 PM, Will Deacon wrote: > On Fri, Jul 17, 2020 at 10:32:53AM +0530, Anshuman Khandual wrote: >> >> >> On 07/16/2020 11:55 PM, Mike Kravetz wrote: >>> >From 17c8f37afbf42fe7412e6eebb3619c6e0b7e1c3c Mon Sep 17 00:00:00 2001 >>> From: M

Re: [PATCH v3] mm/hugetlb: split hugetlb_cma in nodes with memory

2020-07-16 Thread Anshuman Khandual
On 07/16/2020 11:55 PM, Mike Kravetz wrote: >>From 17c8f37afbf42fe7412e6eebb3619c6e0b7e1c3c Mon Sep 17 00:00:00 2001 > From: Mike Kravetz > Date: Tue, 14 Jul 2020 15:54:46 -0700 > Subject: [PATCH] hugetlb: move cma reservation to code setting up gigantic > hstate > > Instead of calling

Re: [PATCH V5 1/4] mm/debug_vm_pgtable: Add tests validating arch helpers for core MM features

2020-07-16 Thread Anshuman Khandual
On 07/16/2020 07:44 PM, Steven Price wrote: > On 13/07/2020 04:23, Anshuman Khandual wrote: >> This adds new tests validating arch page table helpers for these following >> core memory features. These tests create and test specific mapping types at >> various page table lev

Re: [PATCH] riscv: Select ARCH_HAS_DEBUG_VM_PGTABLE

2020-07-14 Thread Anshuman Khandual
On 07/15/2020 02:56 AM, Emil Renner Berthing wrote: > This allows the pgtable tests to be built. > > Signed-off-by: Emil Renner Berthing > --- > > The tests seem to succeed both in Qemu and on the HiFive Unleashed > > Both with and without the recent additions in >

[PATCH V5 4/4] Documentation/mm: Add descriptions for arch page table helpers

2020-07-12 Thread Anshuman Khandual
Cc: linux-a...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Mike Rapoport Suggested-by: Mike Rapoport Signed-off-by: Anshuman Khandual --- Documentation/vm/arch_pgtable_helpers.rst | 258 ++ mm/debug_vm

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