[PATCH V3] mm/page_alloc: Add alloc_contig_pages()

2019-10-17 Thread Anshuman Khandual
Hocko Cc: David Rientjes Cc: Andrea Arcangeli Cc: Oscar Salvador Cc: Mel Gorman Cc: Mike Rapoport Cc: Dan Williams Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: David Hildenbrand Cc: linux-kernel@vger.kernel.org Acked-by: David Hildenbrand Acked-by: Michal Hocko Signed-off-by: Anshuman

Re: [PATCH V2] mm/page_alloc: Add alloc_contig_pages()

2019-10-16 Thread Anshuman Khandual
On 10/16/2019 10:18 PM, David Hildenbrand wrote: > On 16.10.19 17:31, Anshuman Khandual wrote: >> >> >> On 10/16/2019 06:11 PM, Michal Hocko wrote: >>> On Wed 16-10-19 14:29:05, David Hildenbrand wrote: >>>> On 16.10.19 13:51, Michal Hocko wrote

Re: [PATCH V2] mm/page_alloc: Add alloc_contig_pages()

2019-10-16 Thread Anshuman Khandual
On 10/17/2019 06:20 AM, Mike Kravetz wrote: > On 10/16/19 4:02 AM, Anshuman Khandual wrote: >> HugeTLB helper alloc_gigantic_page() implements fairly generic allocation >> method where it scans over various zones looking for a large contiguous pfn >> range befo

Re: [PATCH V2] mm/page_alloc: Add alloc_contig_pages()

2019-10-16 Thread Anshuman Khandual
On 10/16/2019 06:11 PM, Michal Hocko wrote: > On Wed 16-10-19 14:29:05, David Hildenbrand wrote: >> On 16.10.19 13:51, Michal Hocko wrote: >>> On Wed 16-10-19 16:43:57, Anshuman Khandual wrote: >>>> >>>> >>>> On 10/16/2019 04:39 PM, Davi

Re: [PATCH V2] mm/page_alloc: Add alloc_contig_pages()

2019-10-16 Thread Anshuman Khandual
On 10/16/2019 04:39 PM, David Hildenbrand wrote: > On 16.10.19 13:02, Anshuman Khandual wrote: >> HugeTLB helper alloc_gigantic_page() implements fairly generic allocation >> method where it scans over various zones looking for a large contiguous pfn >> range befo

[PATCH V2] mm/page_alloc: Add alloc_contig_pages()

2019-10-16 Thread Anshuman Khandual
Hocko Cc: David Rientjes Cc: Andrea Arcangeli Cc: Oscar Salvador Cc: Mel Gorman Cc: Mike Rapoport Cc: Dan Williams Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: David Hildenbrand Cc: linux-kernel@vger.kernel.org Acked-by: Michal Hocko Signed-off-by: Anshuman Khandual --- This is based on https

Re: [PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Anshuman Khandual
On 10/16/2019 02:28 PM, Michal Hocko wrote: > On Wed 16-10-19 13:04:53, Anshuman Khandual wrote: >> HugeTLB helper alloc_gigantic_page() implements fairly generic allocation >> method where it scans over various zones looking for a large contiguous pfn >> range befo

Re: [PATCH V6 2/2] mm/debug: Add tests validating architecture page table helpers

2019-10-16 Thread Anshuman Khandual
On 10/15/2019 11:39 PM, Qian Cai wrote: > On Tue, 2019-10-15 at 14:51 +0530, Anshuman Khandual wrote: >> +static unsigned long __init get_random_vaddr(void) >> +{ >> +unsigned long random_vaddr, random_pages, total_user_pages; >> + >> +total_user_pages

Re: [PATCH V6 0/2] mm/debug: Add tests validating architecture page table helpers

2019-10-16 Thread Anshuman Khandual
On 10/16/2019 12:12 AM, Qian Cai wrote: > On Tue, 2019-10-15 at 20:51 +0530, Anshuman Khandual wrote: >> >> On 10/15/2019 08:11 PM, Qian Cai wrote: >>> The x86 will crash with linux-next during boot due to this series (v5) with >>> the >>> config

[PATCH] mm/page_alloc: Make alloc_gigantic_page() available for general use

2019-10-16 Thread Anshuman Khandual
Hocko Cc: David Rientjes Cc: Andrea Arcangeli Cc: Oscar Salvador Cc: Mel Gorman Cc: Mike Rapoport Cc: Dan Williams Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: David Hildenbrand Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This is based on https://patchwork.kernel.org

Re: [PATCH V6 0/2] mm/debug: Add tests validating architecture page table helpers

2019-10-15 Thread Anshuman Khandual
On 10/15/2019 08:11 PM, Qian Cai wrote: > The x86 will crash with linux-next during boot due to this series (v5) with > the > config below plus CONFIG_DEBUG_VM_PGTABLE=y. I am not sure if v6 would address > it. > > https://raw.githubusercontent.com/cailca/linux-mm/master/x86.config > > [   

Re: [PATCH V6 2/2] mm/debug: Add tests validating architecture page table helpers

2019-10-15 Thread Anshuman Khandual
On 10/15/2019 05:16 PM, Michal Hocko wrote: > On Tue 15-10-19 14:51:42, Anshuman Khandual wrote: >> This adds tests which will validate architecture page table helpers and >> other accessors in their compliance with expected generic MM semantics. >> This will help

[PATCH V6 2/2] mm/debug: Add tests validating architecture page table helpers

2019-10-15 Thread Anshuman Khandual
rew Morton Signed-off-by: Christophe Leroy Signed-off-by: Anshuman Khandual --- .../debug/debug-vm-pgtable/arch-support.txt | 34 ++ arch/arm64/Kconfig| 1 + arch/x86/Kconfig | 1 + arch/x86/include/asm/pgtable_64.h | 6

[PATCH V6 0/2] mm/debug: Add tests validating architecture page table helpers

2019-10-15 Thread Anshuman Khandual
Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): mm/page_alloc: Make alloc_gigantic_page() available for general use mm/debug: Add tests validating architecture page table helpers .../debug/debug-vm-pgtable/arch-s

[PATCH V10 2/2] arm64/mm: Enable memory hot remove

2019-10-11 Thread Anshuman Khandual
architecture and user page table tear down method. Signed-off-by: Anshuman Khandual Reviewed-by: Catalin Marinas --- arch/arm64/Kconfig | 3 + arch/arm64/include/asm/memory.h | 1 + arch/arm64/mm/mmu.c | 303 ++-- 3 files changed

[PATCH V10 1/2] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump

2019-10-11 Thread Anshuman Khandual
will be enabled by a subsequent patch. To avoid racing with this, take the memory hotplug lock when walking the kernel page table. Acked-by: David Hildenbrand Acked-by: Mark Rutland Signed-off-by: Anshuman Khandual --- arch/arm64/mm/ptdump_debugfs.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH V10 0/2] arm64/mm: Enable memory hot remove

2019-10-11 Thread Anshuman Khandual
and updated all relevant functions Changes in V1: (https://lkml.org/lkml/2019/4/3/28) References: [1] https://lkml.org/lkml/2019/5/28/584 [2] https://lkml.org/lkml/2019/6/11/709 Anshuman Khandual (2): arm64/mm: Hold memory hotplug lock while walking for kernel page table dump arm64/mm: E

[PATCH V5 2/2] mm/debug: Add tests validating architecture page table helpers

2019-10-11 Thread Anshuman Khandual
ophe Leroy Signed-off-by: Anshuman Khandual --- .../debug/debug-vm-pgtable/arch-support.txt| 34 ++ arch/arm64/Kconfig | 1 + arch/x86/Kconfig | 1 + arch/x86/include/asm/pgtable_64.h | 6 + i

[PATCH V5 1/2] mm/hugetlb: Make alloc_gigantic_page() available for general use

2019-10-11 Thread Anshuman Khandual
nux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- include/linux/hugetlb.h | 9 + mm/hugetlb.c| 24 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 4c5a16b..7ff1e36 100644 --- a/inc

[PATCH V5 0/2] mm/debug: Add tests validating architecture page table helpers

2019-10-11 Thread Anshuman Khandual
Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): mm/hugetlb: Make alloc_gigantic_page() available for general use mm/debug: Add tests validating architecture page table helpers .../debug/debug-vm-pgtable/arch-s

Re: [PATCH V9 2/2] arm64/mm: Enable memory hot remove

2019-10-10 Thread Anshuman Khandual
On 10/10/2019 05:04 PM, Catalin Marinas wrote: > Hi Anshuman, > > On Wed, Oct 09, 2019 at 01:51:48PM +0530, Anshuman Khandual wrote: >> +static void unmap_hotplug_pmd_range(pud_t *pudp, unsigned long addr, >> +unsigned long

[PATCH V9 2/2] arm64/mm: Enable memory hot remove

2019-10-09 Thread Anshuman Khandual
architecture and user page table tear down method. Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 3 + arch/arm64/include/asm/memory.h | 1 + arch/arm64/mm/mmu.c | 273 ++-- 3 files changed, 268 insertions(+), 9 deletions(-) diff

[PATCH V9 1/2] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump

2019-10-09 Thread Anshuman Khandual
will be enabled by a subsequent patch. To avoid racing with this, take the memory hotplug lock when walking the kernel page table. Acked-by: David Hildenbrand Acked-by: Mark Rutland Signed-off-by: Anshuman Khandual --- arch/arm64/mm/ptdump_debugfs.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH V9 0/2] arm64/mm: Enable memory hot remove

2019-10-09 Thread Anshuman Khandual
levant functions Changes in V1: (https://lkml.org/lkml/2019/4/3/28) References: [1] https://lkml.org/lkml/2019/5/28/584 [2] https://lkml.org/lkml/2019/6/11/709 Anshuman Khandual (2): arm64/mm: Hold memory hotplug lock while walking for kernel page table dump arm64/mm: Enable memory hot rem

Re: [PATCH V8 2/2] arm64/mm: Enable memory hot remove

2019-10-08 Thread Anshuman Khandual
On 10/08/2019 04:25 PM, Catalin Marinas wrote: > On Tue, Oct 08, 2019 at 10:06:26AM +0530, Anshuman Khandual wrote: >> On 10/07/2019 07:47 PM, Catalin Marinas wrote: >>> On Mon, Sep 23, 2019 at 11:13:45AM +0530, Anshuman Khandual wrote: >>>> The arch code for hot-

Re: [PATCH V4 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-10-08 Thread Anshuman Khandual
On 10/07/2019 07:30 PM, Kirill A. Shutemov wrote: > On Mon, Oct 07, 2019 at 03:51:58PM +0200, Ingo Molnar wrote: >> >> * Kirill A. Shutemov wrote: >> >>> On Mon, Oct 07, 2019 at 03:06:17PM +0200, Ingo Molnar wrote: >>>> >>>> * Anshuman Kha

Re: [PATCH V4 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-10-08 Thread Anshuman Khandual
On 10/07/2019 06:36 PM, Ingo Molnar wrote: > > * Anshuman Khandual wrote: > >> This adds a test module which will validate architecture page table helpers >> and accessors regarding compliance with generic MM semantics expectations. >> This will help various

Re: [PATCH V8 2/2] arm64/mm: Enable memory hot remove

2019-10-07 Thread Anshuman Khandual
On 10/07/2019 07:47 PM, Catalin Marinas wrote: > On Mon, Sep 23, 2019 at 11:13:45AM +0530, Anshuman Khandual wrote: >> The arch code for hot-remove must tear down portions of the linear map and >> vmemmap corresponding to memory being removed. In both cases the page &g

[PATCH V4 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-10-06 Thread Anshuman Khandual
kernel.org Suggested-by: Catalin Marinas Signed-off-by: Christophe Leroy Tested-by: Christophe Leroy#PPC32 Signed-off-by: Anshuman Khandual --- arch/x86/include/asm/pgtable_64_types.h | 2 + mm/Kconfig.debug| 15 + mm/Makefile |

[PATCH V4 1/2] mm/hugetlb: Make alloc_gigantic_page() available for general use

2019-10-06 Thread Anshuman Khandual
nux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- include/linux/hugetlb.h | 9 + mm/hugetlb.c| 24 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 53fc34f930d0..cc50d5ad4

[PATCH V4 0/2] mm/debug: Add tests for architecture exported page table helpers

2019-10-06 Thread Anshuman Khandual
ead.org Cc: linux-i...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): mm/hugetlb: Make alloc_gigantic_page() available for genera

Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()

2019-10-04 Thread Anshuman Khandual
On 10/04/2019 04:28 PM, Michal Hocko wrote: > On Thu 03-10-19 13:40:57, Anshuman Khandual wrote: >> Having unmovable pages on a given pageblock should be reported correctly >> when required with REPORT_FAILURE flag. But there can be a scenario where a >> reserved page in th

Re: [PATCH] arm64/mm: Poison initmem while freeing with free_reserved_area()

2019-10-04 Thread Anshuman Khandual
On 10/04/2019 03:49 PM, Steven Price wrote: > On 04/10/2019 05:23, Anshuman Khandual wrote: >> Platform implementation for free_initmem() should poison the memory while >> freeing it up. Hence pass across POISON_FREE_INITMEM while calling into >> free_reserved_area(). The s

[PATCH] arm64/mm: Poison initmem while freeing with free_reserved_area()

2019-10-03 Thread Anshuman Khandual
Cc: Will Deacon Cc: Mark Rutland Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 45c00a54909c..ea7d38011e83 100644 --- a/arch/arm64

Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()

2019-10-03 Thread Anshuman Khandual
On 10/03/2019 05:20 PM, Qian Cai wrote: > > >> On Oct 3, 2019, at 7:31 AM, Anshuman Khandual >> wrote: >> >> Ohh, never meant that the 'Reserved' bit is anything special here but it >> is a reason to make a page unmovable unlike many other flags. >

Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()

2019-10-03 Thread Anshuman Khandual
On 10/03/2019 04:49 PM, Qian Cai wrote: > > >> On Oct 3, 2019, at 5:32 AM, Anshuman Khandual >> wrote: >> >> Even though page flags does contain reserved bit information, the problem >> is that we are explicitly printing the reason for this pag

Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()

2019-10-03 Thread Anshuman Khandual
On 10/03/2019 03:02 PM, Anshuman Khandual wrote: > > On 10/03/2019 02:35 PM, Qian Cai wrote: >> >>> On Oct 3, 2019, at 4:10 AM, Anshuman Khandual >>> wrote: >>> >>> Having unmovable pages on a given pageblock should be reported corr

Re: [PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()

2019-10-03 Thread Anshuman Khandual
On 10/03/2019 02:35 PM, Qian Cai wrote: > > >> On Oct 3, 2019, at 4:10 AM, Anshuman Khandual >> wrote: >> >> Having unmovable pages on a given pageblock should be reported correctly >> when required with REPORT_FAILURE flag. But there can be a scenario

[PATCH] mm/page_alloc: Add a reason for reserved pages in has_unmovable_pages()

2019-10-03 Thread Anshuman Khandual
ate reason code like "Reserved page". Cc: Andrew Morton Cc: Michal Hocko Cc: Vlastimil Babka Cc: Oscar Salvador Cc: Mel Gorman Cc: Mike Rapoport Cc: Dan Williams Cc: Pavel Tatashin Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- mm/page_alloc.c | 4 +++

Re: [PATCH v4] arm64: use generic free_initrd_mem()

2019-09-29 Thread Anshuman Khandual
implementation of free_initrd_mem() on arm64. This improves free_initrd_mem() generic implementation for others to use. > > Signed-off-by: Mike Rapoport Tested-by: Anshuman Khandual #arm64 Reviewed-by: Anshuman Khandual > --- > > v4: > * memblock_free() aligned area ar

Re: [PATCH v3] arm64: use generic free_initrd_mem()

2019-09-27 Thread Anshuman Khandual
On 09/25/2019 10:39 AM, Mike Rapoport wrote: > From: Mike Rapoport > > arm64 calls memblock_free() for the initrd area in its implementation of > free_initrd_mem(), but this call has no actual effect that late in the boot > process. By the time initrd is freed, all the reserved memory is

Re: [PATCH] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-24 Thread Anshuman Khandual
On 09/25/2019 08:43 AM, Andrew Morton wrote: > On Mon, 23 Sep 2019 11:16:38 +0530 Anshuman Khandual > wrote: > >> >> >> On 09/16/2019 11:17 AM, Anshuman Khandual wrote: >>> In add_memory_resource() the memory range to be hot added first gets into >&g

Re: [PATCH V3 0/2] mm/debug: Add tests for architecture exported page table helpers

2019-09-24 Thread Anshuman Khandual
On 09/24/2019 06:01 PM, Mike Rapoport wrote: > On Tue, Sep 24, 2019 at 02:51:01PM +0300, Kirill A. Shutemov wrote: >> On Fri, Sep 20, 2019 at 12:03:21PM +0530, Anshuman Khandual wrote: >>> This series adds a test validation for architecture exported page table >>> h

[PATCH V2] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-24 Thread Anshuman Khandual
Hildenbrand Cc: Pavel Tatashin Cc: Dan Williams Signed-off-by: Anshuman Khandual --- Changes in V2: - Changed the commit message as per Michal and David Changed in V1: https://patchwork.kernel.org/patch/11146361/ Original patch https://lkml.org/lkml/2019/9/3/327 Memory hot remove now works

Re: [PATCH V8 2/2] arm64/mm: Enable memory hot remove

2019-09-24 Thread Anshuman Khandual
On 09/23/2019 04:47 PM, Matthew Wilcox wrote: > On Mon, Sep 23, 2019 at 11:13:45AM +0530, Anshuman Khandual wrote: >> +#ifdef CONFIG_MEMORY_HOTPLUG >> +static void free_hotplug_page_range(struct page *page, size_t size) >> +{ >> +WARN_ON(!page || PageReserved

[PATCH] mm/memremap: Drop unused SECTION_SIZE and SECTION_MASK

2019-09-24 Thread Anshuman Khandual
: Jason Gunthorpe Cc: Logan Gunthorpe Cc: Ira Weiny Cc: linux-kernel@vger.kernel.org Reported-by: kbuild test robot Signed-off-by: Anshuman Khandual --- Build and boot tested on arm64 platform with ZONE_DEVICE enabled. But only boot tested on arm64 and some other platforms with allmodconfig.

Re: [PATCH] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-23 Thread Anshuman Khandual
On 09/23/2019 04:24 PM, David Hildenbrand wrote: > On 23.09.19 12:52, Michal Hocko wrote: >> On Mon 16-09-19 11:17:37, Anshuman Khandual wrote: >>> In add_memory_resource() the memory range to be hot added first gets into >>> the memblock via memblock_add() before

Re: [PATCH] arm64: use generic free_initrd_mem()

2019-09-23 Thread Anshuman Khandual
On 09/16/2019 07:25 PM, Mike Rapoport wrote: > (added linux-arch) > > On Mon, Sep 16, 2019 at 08:23:29AM -0400, Laura Abbott wrote: >> On 9/16/19 8:21 AM, Mike Rapoport wrote: >>> From: Mike Rapoport >>> >>> arm64 calls memblock_free() for the initrd area in its implementation of >>>

Re: [PATCH V3 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-23 Thread Anshuman Khandual
ote to help > improve the system. BTW, we also suggest to use '--base' option to specify the > base tree in git format-patch, please see > https://stackoverflow.com/a/37406982] > > url: > https://github.com/0day-ci/linux/commits/Anshuman-Khandual/mm-debug-Add-tests-for-a

Re: [PATCH] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-22 Thread Anshuman Khandual
On 09/16/2019 11:17 AM, Anshuman Khandual wrote: > In add_memory_resource() the memory range to be hot added first gets into > the memblock via memblock_add() before arch_add_memory() is called on it. > Reverse sequence should be followed during memory hot removal which already &

[PATCH V8 0/2] arm64/mm: Enable memory hot remove

2019-09-22 Thread Anshuman Khandual
Skipped calling into pgtable_page_dtor() for linear mapping page table pages and updated all relevant functions Changes in V1: (https://lkml.org/lkml/2019/4/3/28) References: [1] https://lkml.org/lkml/2019/5/28/584 [2] https://lkml.org/lkml/2019/6/11/709 Anshuman Khandual (2): arm64/mm: Hold mem

[PATCH V8 2/2] arm64/mm: Enable memory hot remove

2019-09-22 Thread Anshuman Khandual
architecture and user page table tear down method. Acked-by: Steve Capper Acked-by: David Hildenbrand Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 3 + arch/arm64/include/asm/memory.h | 1 + arch/arm64/mm/mmu.c | 305

[PATCH V8 1/2] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump

2019-09-22 Thread Anshuman Khandual
will be enabled by a subsequent patch. To avoid racing with this, take the memory hotplug lock when walking the kernel page table. Acked-by: David Hildenbrand Acked-by: Mark Rutland Signed-off-by: Anshuman Khandual --- arch/arm64/mm/ptdump_debugfs.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH V3 1/2] mm/hugetlb: Make alloc_gigantic_page() available for general use

2019-09-20 Thread Anshuman Khandual
memory block. In the future such methods might have other use cases as well. So alloc_gigantic_page() has been split carving out actual memory allocation method and made available via new alloc_gigantic_page_order(). Cc: Mike Kravetz Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman

[PATCH V3 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-20 Thread Anshuman Khandual
kernel.org Suggested-by: Catalin Marinas Signed-off-by: Christophe Leroy Tested-by: Christophe Leroy(PPC32) Signed-off-by: Anshuman Khandual --- arch/x86/include/asm/pgtable_64_types.h | 2 + mm/Kconfig.debug| 14 + mm/Makefile |

[PATCH V3 0/2] mm/debug: Add tests for architecture exported page table helpers

2019-09-20 Thread Anshuman Khandual
ead.org Cc: linux-i...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): mm/hugetlb: Make alloc_gigantic_page() available for genera

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-19 Thread Anshuman Khandual
On 09/18/2019 11:52 PM, Gerald Schaefer wrote: > On Wed, 18 Sep 2019 18:26:03 +0200 > Christophe Leroy wrote: > > [..] >> My suggestion was not to completely drop the #ifdef but to do like you >> did in pgd_clear_tests() for instance, ie to add the following test on >> top of the function:

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-18 Thread Anshuman Khandual
On 09/18/2019 09:56 PM, Christophe Leroy wrote: > > > Le 18/09/2019 à 07:04, Anshuman Khandual a écrit : >> >> >> On 09/13/2019 03:31 PM, Christophe Leroy wrote: >>> >>> >>> Le 13/09/2019 à 11:02, Anshuman Khandual a écrit : >>

Re: [PATCH V7 1/3] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-18 Thread Anshuman Khandual
On 09/16/2019 07:14 AM, Balbir Singh wrote: > > > On 3/9/19 7:45 pm, Anshuman Khandual wrote: >> Memory hot remove uses get_nid_for_pfn() while tearing down linked sysfs > > I could not find this path in the code, the only called for get_nid_for_pfn() > was regi

Re: [PATCH V7 2/3] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump

2019-09-18 Thread Anshuman Khandual
On 09/15/2019 08:05 AM, Balbir Singh wrote: > > > On 3/9/19 7:45 pm, Anshuman Khandual wrote: >> The arm64 page table dump code can race with concurrent modification of the >> kernel page tables. When a leaf entries are modified concurrently, the dump >> code ma

Re: [PATCH] mm/pgtable/debug: Fix test validating architecture page table helpers

2019-09-18 Thread Anshuman Khandual
On 09/13/2019 11:53 AM, Christophe Leroy wrote: > Fix build failure on powerpc. > > Fix preemption imbalance. > > Signed-off-by: Christophe Leroy > --- > mm/arch_pgtable_test.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/arch_pgtable_test.c b/mm/arch_pgtable_test.c >

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-17 Thread Anshuman Khandual
On 09/13/2019 03:31 PM, Christophe Leroy wrote: > > > Le 13/09/2019 à 11:02, Anshuman Khandual a écrit : >> >>>> +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(__ARCH_HAS_4LEVEL_HACK) >>> >>> #ifdefs have to be avoided as much as possibl

Re: [PATCH V7 3/3] arm64/mm: Enable memory hot remove

2019-09-16 Thread Anshuman Khandual
On 09/13/2019 03:39 PM, Catalin Marinas wrote: > On Fri, Sep 13, 2019 at 11:28:01AM +0530, Anshuman Khandual wrote: >> On 09/13/2019 01:45 AM, Catalin Marinas wrote: >>> On Tue, Sep 03, 2019 at 03:15:58PM +0530, Anshuman Khandual wrote: >>>> @@ -770,6 +1022,28 @@

Re: [PATCH] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-16 Thread Anshuman Khandual
On 09/16/2019 02:20 PM, Anshuman Khandual wrote: > > > On 09/16/2019 12:06 PM, Mike Rapoport wrote: >> On Mon, Sep 16, 2019 at 11:17:37AM +0530, Anshuman Khandual wrote: >>> In add_memory_resource() the memory range to be hot added first gets into >>> the m

Re: [PATCH] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-16 Thread Anshuman Khandual
On 09/16/2019 12:06 PM, Mike Rapoport wrote: > On Mon, Sep 16, 2019 at 11:17:37AM +0530, Anshuman Khandual wrote: >> In add_memory_resource() the memory range to be hot added first gets into >> the memblock via memblock_add() before arch_add_memory() is called on it. >> Re

[PATCH] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-15 Thread Anshuman Khandual
required re-order between memblock_[free|remove]() and arch_remove_memory() during memory hot-remove. Cc: Andrew Morton Cc: Oscar Salvador Cc: Michal Hocko Cc: David Hildenbrand Cc: Pavel Tatashin Cc: Dan Williams Signed-off-by: Anshuman Khandual --- Original patch https://lkml.org/lkml/2019/9

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-13 Thread Anshuman Khandual
On 09/12/2019 10:44 PM, Christophe Leroy wrote: > > > Le 12/09/2019 à 08:02, Anshuman Khandual a écrit : >> This adds a test module which will validate architecture page table helpers >> and accessors regarding compliance with generic MM semantics expectations. >

Re: [PATCH] mm/pgtable/debug: Fix test validating architecture page table helpers

2019-09-13 Thread Anshuman Khandual
On 09/13/2019 12:41 PM, Christophe Leroy wrote: > > > Le 13/09/2019 à 09:03, Christophe Leroy a écrit : >> >> >> Le 13/09/2019 à 08:58, Anshuman Khandual a écrit : >>> On 09/13/2019 11:53 AM, Christophe Leroy wrote: >>>> Fix build failur

Re: [PATCH] mm/pgtable/debug: Fix test validating architecture page table helpers

2019-09-13 Thread Anshuman Khandual
On 09/13/2019 11:53 AM, Christophe Leroy wrote: > Fix build failure on powerpc. > > Fix preemption imbalance. > > Signed-off-by: Christophe Leroy > --- > mm/arch_pgtable_test.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/mm/arch_pgtable_test.c b/mm/arch_pgtable_test.c > index

Re: [PATCH V2 0/2] mm/debug: Add tests for architecture exported page table helpers

2019-09-13 Thread Anshuman Khandual
On 09/12/2019 08:12 PM, Christophe Leroy wrote: > Hi, > > I didn't get patch 1 of this series, and it is not on linuxppc-dev patchwork > either. Can you resend ? Its there on linux-mm patchwork and copied on linux-kernel@vger.kernel.org as well. The CC list for the first patch was different

Re: [PATCH V7 3/3] arm64/mm: Enable memory hot remove

2019-09-12 Thread Anshuman Khandual
On 09/13/2019 01:45 AM, Catalin Marinas wrote: > Hi Anshuman, > > Thanks for the details on the need for removing the page tables and > vmemmap backing. Some comments on the code below. > > On Tue, Sep 03, 2019 at 03:15:58PM +0530, Anshuman Khandual wrote: >> --- a/arch

Re: [PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-12 Thread Anshuman Khandual
On 09/12/2019 04:30 PM, Kirill A. Shutemov wrote: > On Thu, Sep 12, 2019 at 11:32:53AM +0530, Anshuman Khandual wrote: >> +MODULE_LICENSE("GPL v2"); >> +MODULE_AUTHOR("Anshuman Khandual "); >> +MODULE_DESCRIPTION("Test architecture page table helpe

Re: [PATCH V7 3/3] arm64/mm: Enable memory hot remove

2019-09-12 Thread Anshuman Khandual
On 09/12/2019 09:58 AM, Anshuman Khandual wrote: > > On 09/10/2019 09:47 PM, Catalin Marinas wrote: >> On Tue, Sep 03, 2019 at 03:15:58PM +0530, Anshuman Khandual wrote: >>> @@ -770,6 +1022,28 @@ int __meminit vmemmap_populate(unsigned long start, >>> unsigned

[PATCH V2 2/2] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-12 Thread Anshuman Khandual
kernel.org Suggested-by: Catalin Marinas Signed-off-by: Anshuman Khandual --- arch/x86/include/asm/pgtable_64_types.h | 2 + mm/Kconfig.debug| 14 + mm/Makefile | 1 + mm/arch_pgtable_test.c | 429 +++

[PATCH V2 1/2] mm/hugetlb: Make alloc_gigantic_page() available for general use

2019-09-12 Thread Anshuman Khandual
memory block. In the future such methods might have other use cases as well. So alloc_gigantic_page() has been split carving out actual memory allocation method and made available via new alloc_gigantic_page_order(). Cc: Mike Kravetz Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman

[PATCH V2 0/2] mm/debug: Add tests for architecture exported page table helpers

2019-09-12 Thread Anshuman Khandual
nel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): mm/hugetlb: Make alloc_gigantic_page() available for general use mm/pgtable/debug: Add test validating architecture page table helpers arch/x86/include/asm/pgtable_64_types.h | 2 + include/linux/hugetlb.h |

Re: [PATCH V7 3/3] arm64/mm: Enable memory hot remove

2019-09-11 Thread Anshuman Khandual
On 09/10/2019 09:47 PM, Catalin Marinas wrote: > On Tue, Sep 03, 2019 at 03:15:58PM +0530, Anshuman Khandual wrote: >> @@ -770,6 +1022,28 @@ int __meminit vmemmap_populate(unsigned long start, >> unsigned long end, int node, >> void vmemmap_free(unsigned long sta

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-09 Thread Anshuman Khandual
On 09/10/2019 10:15 AM, Christophe Leroy wrote: > > > On 09/10/2019 03:56 AM, Anshuman Khandual wrote: >> >> >> On 09/09/2019 08:43 PM, Kirill A. Shutemov wrote: >>> On Mon, Sep 09, 2019 at 11:56:50AM +0530, Anshuman Khandual wrote: >>>> >>

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-09 Thread Anshuman Khandual
On 09/09/2019 08:43 PM, Kirill A. Shutemov wrote: > On Mon, Sep 09, 2019 at 11:56:50AM +0530, Anshuman Khandual wrote: >> >> >> On 09/07/2019 12:33 AM, Gerald Schaefer wrote: >>> On Fri, 6 Sep 2019 11:58:59 +0530 >>> Anshuman Khandual wrote: >>&

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-09 Thread Anshuman Khandual
On 09/07/2019 12:33 AM, Gerald Schaefer wrote: > On Fri, 6 Sep 2019 11:58:59 +0530 > Anshuman Khandual wrote: > >> On 09/05/2019 10:36 PM, Gerald Schaefer wrote: >>> On Thu, 5 Sep 2019 14:48:14 +0530 >>> Anshuman Khandual wrote: >>> >

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-06 Thread Anshuman Khandual
On 09/05/2019 02:29 PM, Kirill A. Shutemov wrote: > On Thu, Sep 05, 2019 at 01:48:27PM +0530, Anshuman Khandual wrote: >>>> +#define VADDR_TEST(PGDIR_SIZE + PUD_SIZE + PMD_SIZE + PAGE_SIZE) >>> >>> What is special about this address? How do you k

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-06 Thread Anshuman Khandual
On 09/05/2019 10:36 PM, Gerald Schaefer wrote: > On Thu, 5 Sep 2019 14:48:14 +0530 > Anshuman Khandual wrote: > >>> [...] >>>> + >>>> +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(__ARCH_HAS_4LEVEL_HACK) >>>> +static

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-05 Thread Anshuman Khandual
On 09/05/2019 01:46 AM, Gerald Schaefer wrote: > On Tue, 3 Sep 2019 13:31:46 +0530 > Anshuman Khandual wrote: > >> This adds a test module which will validate architecture page table helpers >> and accessors regarding compliance with generic MM semantics expectatio

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-05 Thread Anshuman Khandual
On 09/04/2019 07:49 PM, Kirill A. Shutemov wrote: > On Tue, Sep 03, 2019 at 01:31:46PM +0530, Anshuman Khandual wrote: >> This adds a test module which will validate architecture page table helpers >> and accessors regarding compliance with generic MM semantics expectations. &g

Re: [PATCH V7 1/3] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-04 Thread Anshuman Khandual
On 09/04/2019 01:46 PM, David Hildenbrand wrote: > On 03.09.19 11:45, Anshuman Khandual wrote: >> Memory hot remove uses get_nid_for_pfn() while tearing down linked sysfs >> entries between memory block and node. It first checks pfn validity with >> pfn_valid_within(

Re: [PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-04 Thread Anshuman Khandual
us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Anshuman-Khandual/mm-debug-Add-tests-for-architecture-exported-page-table-helpers/20190903-162959 > config: m68k-allmodconfig (attached as .config) > compiler: m68k-linux-gcc (GCC) 7.4

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Anshuman Khandual
On 09/04/2019 10:27 AM, Justin He (Arm Technology China) wrote: > Hi Anshuman, thanks for the comments, see below please > >> -Original Message----- >> From: Anshuman Khandual >> Sent: 2019年9月4日 12:38 >> To: Justin He (Arm Technology China) ; Andrew >>

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Anshuman Khandual
On 09/04/2019 08:49 AM, Anshuman Khandual wrote: > /* >* This really shouldn't fail, because the page is there >* in the page tables. But it might just be unreadable, >* in which case we just give up and fil

Re: [PATCH] mm: fix double page fault on arm64 if PTE_AF is cleared

2019-09-03 Thread Anshuman Khandual
On 09/04/2019 06:28 AM, Jia He wrote: > When we tested pmdk unit test [1] vmmalloc_fork TEST1 in arm64 guest, there > will be a double page fault in __copy_from_user_inatomic of cow_user_page. > > Below call trace is from arm64 do_page_fault for debugging purpose > [ 110.016195] Call trace: > [

[PATCH V7 3/3] arm64/mm: Enable memory hot remove

2019-09-03 Thread Anshuman Khandual
with ARCH_ENABLE_MEMORY_HOTREMOVE. This implementation is overall inspired from kernel page table tear down procedure on X86 architecture. Acked-by: Steve Capper Acked-by: David Hildenbrand Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 3 + arch/arm64/include/asm/memory.h | 1 + arch/arm64

[PATCH V7 2/3] arm64/mm: Hold memory hotplug lock while walking for kernel page table dump

2019-09-03 Thread Anshuman Khandual
will be enabled by a subsequent patch. To avoid racing with this, take the memory hotplug lock when walking the kernel page table. Acked-by: David Hildenbrand Acked-by: Mark Rutland Signed-off-by: Anshuman Khandual --- arch/arm64/mm/ptdump_debugfs.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH V7 1/3] mm/hotplug: Reorder memblock_[free|remove]() calls in try_remove_memory()

2019-09-03 Thread Anshuman Khandual
nbrand Reviewed-by: Oscar Salvador Acked-by: Mark Rutland Acked-by: Michal Hocko Signed-off-by: Anshuman Khandual --- mm/memory_hotplug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index c73f09913165..355c466e0621 100644 --

[PATCH V7 0/3] arm64/mm: Enable memory hot remove

2019-09-03 Thread Anshuman Khandual
gtable_page_dtor() for linear mapping page table pages and updated all relevant functions Changes in V1: (https://lkml.org/lkml/2019/4/3/28) References: [1] https://lkml.org/lkml/2019/5/28/584 [2] https://lkml.org/lkml/2019/6/11/709 Anshuman Khandual (3): mm/hotplug: Reorder memblock_[free

[PATCH 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-09-03 Thread Anshuman Khandual
ux-arm-ker...@lists.infradead.org Cc: linux-i...@vger.kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Suggested-by: Catalin Marinas Signed-off-by: Anshuma

[PATCH 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-09-03 Thread Anshuman Khandual
nel.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (1): mm/pgtable/debug: Add test validating architecture page table helpers mm/Kconfig.debug | 14 ++ mm/Makefile| 1 + mm/arch_pgtable_te

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-28 Thread Anshuman Khandual
On 08/26/2019 06:43 PM, Matthew Wilcox wrote: > On Mon, Aug 26, 2019 at 08:07:13AM +0530, Anshuman Khandual wrote: >> On 08/09/2019 07:22 PM, Matthew Wilcox wrote: >>> On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: >>>> On 08/09/2019

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Anshuman Khandual
On 08/09/2019 03:46 PM, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: >> Should alloc_gigantic_page() be made available as an interface for general >> use in the kernel. The test module here uses very similar implementation

Re: [PATCH] mm/sparse: use __nr_to_section(section_nr) to get mem_section

2019-08-09 Thread Anshuman Khandual
d-off-by: Wei Yang Looks right. With this applied, memory hot add still works on arm64. Reviewed-by: Anshuman Khandual > --- > mm/sparse.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/sparse.c b/mm/sparse.c > index 72f010d9bff5..95158a148cd1 1

[RFC V2 1/1] mm/pgtable/debug: Add test validating architecture page table helpers

2019-08-09 Thread Anshuman Khandual
y: Catalin Marinas Signed-off-by: Anshuman Khandual --- mm/Kconfig.debug | 14 ++ mm/Makefile| 1 + mm/arch_pgtable_test.c | 400 + 3 files changed, 415 insertions(+) create mode 100644 mm/arch_pgtable_test.c diff --git a/mm/Kconfig.

[RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-09 Thread Anshuman Khandual
.org Cc: x...@kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (1): mm/pgtable/debug: Add test validating architecture page table helpers mm/Kconfig.debug | 14 ++ mm/Makefile| 1 + mm/arch_pgtable_test.c | 400 + 3 files ch

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