Re: [PATCH v1] mm: relax deferred struct page requirements

2018-06-19 Thread Pavel Tatashin
On Sat, Jun 16, 2018 at 4:04 AM Jiri Slaby wrote: > > On 11/21/2017, 08:24 AM, Michal Hocko wrote: > > On Thu 16-11-17 20:46:01, Pavel Tatashin wrote: > >> There is no need to have ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT, > >> as all the page initialization code is

Re: [PATCH v1] mm: relax deferred struct page requirements

2018-06-19 Thread Pavel Tatashin
On Tue, Jun 19, 2018 at 9:50 AM Pavel Tatashin wrote: > > On Sat, Jun 16, 2018 at 4:04 AM Jiri Slaby wrote: > > > > On 11/21/2017, 08:24 AM, Michal Hocko wrote: > > > On Thu 16-11-17 20:46:01, Pavel Tatashin wrote: > > >> There is no need to have

Re: [PATCHv3 2/4] drivers/base: utilize device tree info to shutdown devices

2018-07-03 Thread Pavel Tatashin
Thank you Andy for the heads up. I might need to rebase my work (http://lkml.kernel.org/r/20180629182541.6735-1-pasha.tatas...@oracle.com) based on this change. But, it is possible it is going to be harder to parallelize based on device tree. I will need to think about it. Pavel On Tue, Jul 3, 20

Re: Boot failures with "mm/sparse: Remove CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER" on powerpc (was Re: mmotm 2018-07-10-16-50 uploaded)

2018-07-11 Thread Pavel Tatashin
I am OK, if this patch is removed from Baoquan's series. But, I would still like to get rid of CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER, I can work on this in my sparse_init re-write series. ppc64 should really fallback safely to small chunks allocs, and if it does not there is some existing bug. Mi

Re: Boot failures with "mm/sparse: Remove CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER" on powerpc (was Re: mmotm 2018-07-10-16-50 uploaded)

2018-07-12 Thread Pavel Tatashin
On Thu, Jul 12, 2018 at 5:50 AM Oscar Salvador wrote: > > > > I just roughly check, but if I checked the right place, > > > vmemmap_populated() checks for the section to contain the flags we are > > > setting in sparse_init_one_section(). > > > > Yes. > > > > > But with this patch, we populate fir

Re: [next-20180711][Oops] linux-next kernel boot is broken on powerpc

2018-07-12 Thread Pavel Tatashin
> Related commit could be one of below ? I see lots of patches related to mm > and could not bisect > > 5479976fda7d3ab23ba0a4eb4d60b296eb88b866 mm: page_alloc: restore > memblock_next_valid_pfn() on arm/arm64 > 41619b27b5696e7e5ef76d9c692dd7342c1ad7eb > mm-drop-vm_bug_on-from-__get_free_pages-f

Re: [next-20180711][Oops] linux-next kernel boot is broken on powerpc

2018-07-17 Thread Pavel Tatashin
On Tue, Jul 17, 2018 at 6:49 AM Abdul Haleem wrote: > > On Sat, 2018-07-14 at 10:55 +1000, Stephen Rothwell wrote: > > Hi Abdul, > > > > On Fri, 13 Jul 2018 14:43:11 +0530 Abdul Haleem > > wrote: > > > > > > On Thu, 2018-07-12 at 13:44 -0400, Pave

[v1 5/5] mm: teach platforms not to zero struct pages memory

2017-03-23 Thread Pavel Tatashin
quot; using the boot CPU. This patch solves this problem, by deferring zeroing "struct pages" to only when they are initialized. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/powerpc/mm/init_64.c |2 +- arch/sparc/mm/init_64.c |2 +- arch/x86/mm/init_64.c

[v1 0/5] parallelized "struct page" zeroing

2017-03-23 Thread Pavel Tatashin
size) because there are twice as many "struct page"es for the same amount of memory, as base pages are twice smaller. Pavel Tatashin (5): sparc64: simplify vmemmap_populate mm: defining memblock_virt_alloc_try_nid_raw mm: add "zero" argument to vmemmap allocators m

[v1 1/5] sparc64: simplify vmemmap_populate

2017-03-23 Thread Pavel Tatashin
Remove duplicating code, by using common functions vmemmap_pud_populate and vmemmap_pgd_populate functions. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/sparc/mm/init_64.c | 23 ++- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/arch

[v1 4/5] mm: zero struct pages during initialization

2017-03-23 Thread Pavel Tatashin
memory or can deffer it. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- include/linux/mm.h |9 + mm/page_alloc.c|3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 54df194..eb052f6 100644 --- a/inc

[v1 2/5] mm: defining memblock_virt_alloc_try_nid_raw

2017-03-23 Thread Pavel Tatashin
A new version of memblock_virt_alloc_* allocations: - Does not zero the allocated memory - Does not panic if request cannot be satisfied Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- include/linux/bootmem.h |3 +++ mm/memblock.c | 46

[v1 3/5] mm: add "zero" argument to vmemmap allocators

2017-03-23 Thread Pavel Tatashin
: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/powerpc/mm/init_64.c |4 +- arch/s390/mm/vmem.c |5 ++- arch/sparc/mm/init_64.c |3 +- arch/x86/mm/init_64.c |3 +- include/linux/mm.h|6 ++-- mm/sparse-vmemmap.c | 48

[v2 2/5] mm: defining memblock_virt_alloc_try_nid_raw

2017-03-24 Thread Pavel Tatashin
A new version of memblock_virt_alloc_* allocations: - Does not zero the allocated memory - Does not panic if request cannot be satisfied Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- include/linux/bootmem.h |3 +++ mm/memblock.c | 46

[v2 4/5] mm: zero struct pages during initialization

2017-03-24 Thread Pavel Tatashin
memory or can deffer it. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- include/linux/mm.h |9 + mm/page_alloc.c|3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 54df194..eb052f6 100644 --- a/inc

[v2 5/5] mm: teach platforms not to zero struct pages memory

2017-03-24 Thread Pavel Tatashin
quot; using the boot CPU. This patch solves this problem, by deferring zeroing "struct pages" to only when they are initialized. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/powerpc/mm/init_64.c |2 +- arch/s390/mm/vmem.c |2 +- arch/sparc/mm/init

[v2 3/5] mm: add "zero" argument to vmemmap allocators

2017-03-24 Thread Pavel Tatashin
: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/powerpc/mm/init_64.c |4 +- arch/s390/mm/vmem.c |5 ++- arch/sparc/mm/init_64.c |3 +- arch/x86/mm/init_64.c |3 +- include/linux/mm.h|6 ++-- mm/sparse-vmemmap.c | 48

[v2 0/5] parallelized "struct page" zeroing

2017-03-24 Thread Pavel Tatashin
t it takes only additional 0.456s per node, which means on Intel we also benefit from having memset() and initializing all other fields in one place. Pavel Tatashin (5): sparc64: simplify vmemmap_populate mm: defining memblock_virt_alloc_try_nid_raw mm: add "zero" argument to vme

[v2 1/5] sparc64: simplify vmemmap_populate

2017-03-24 Thread Pavel Tatashin
Remove duplicating code, by using common functions vmemmap_pud_populate and vmemmap_pgd_populate functions. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/sparc/mm/init_64.c | 23 ++- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/arch

[v3 2/9] mm: defining memblock_virt_alloc_try_nid_raw

2017-05-05 Thread Pavel Tatashin
A new version of memblock_virt_alloc_* allocations: - Does not zero the allocated memory - Does not panic if request cannot be satisfied Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- include/linux/bootmem.h |3 +++ mm/memblock.c | 46

[v3 5/9] mm: zero struct pages during initialization

2017-05-05 Thread Pavel Tatashin
memory or can deffer it. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- include/linux/mm.h |9 + mm/page_alloc.c|3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 4375015..1c481fc 100644 --- a/inc

[v3 9/9] s390: teach platforms not to zero struct pages memory

2017-05-05 Thread Pavel Tatashin
quot; using the boot CPU. This patch solves this problem, by deferring zeroing "struct pages" to only when they are initialized on s390 platforms. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/s390/mm/vmem.c |2 +- 1 files changed, 1 insertions(+), 1 deletions

[v3 7/9] x86: teach x86 not to zero struct pages memory

2017-05-05 Thread Pavel Tatashin
quot; using the boot CPU. This patch solves this problem, by deferring zeroing "struct pages" to only when they are initialized on x86 platforms. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/x86/mm/init_64.c |2 +- 1 files changed, 1 insertions(+), 1 deletion

[v3 3/9] mm: add "zero" argument to vmemmap allocators

2017-05-05 Thread Pavel Tatashin
: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/powerpc/mm/init_64.c |4 +- arch/s390/mm/vmem.c |5 ++- arch/sparc/mm/init_64.c |3 +- arch/x86/mm/init_64.c |3 +- include/linux/mm.h|6 ++-- mm/sparse-vmemmap.c | 48

[v3 6/9] sparc64: teach sparc not to zero struct pages memory

2017-05-05 Thread Pavel Tatashin
quot; using the boot CPU. This patch solves this problem, by deferring zeroing "struct pages" to only when they are initialized on SPARC. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/sparc/mm/init_64.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(

[v3 4/9] mm: do not zero vmemmap_buf

2017-05-05 Thread Pavel Tatashin
memmap_buf beforehand. Let clients of alloc_block_buf() to decide whether that is needed. Signed-off-by: Pavel Tatashin --- mm/sparse-vmemmap.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index 5d255b0..1e9508b 100644 --- a/mm/sparse

[v3 1/9] sparc64: simplify vmemmap_populate

2017-05-05 Thread Pavel Tatashin
Remove duplicating code, by using common functions vmemmap_pud_populate and vmemmap_pgd_populate functions. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/sparc/mm/init_64.c | 23 ++- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/arch

[v3 0/9] parallelized "struct page" zeroing

2017-05-05 Thread Pavel Tatashin
enefit from having memset() and initializing all other fields in one place. Pavel Tatashin (9): sparc64: simplify vmemmap_populate mm: defining memblock_virt_alloc_try_nid_raw mm: add "zero" argument to vmemmap allocators mm: do not zero vmemmap_buf mm: zero struct pages dur

[v3 8/9] powerpc: teach platforms not to zero struct pages memory

2017-05-05 Thread Pavel Tatashin
quot; using the boot CPU. This patch solves this problem, by deferring zeroing "struct pages" to only when they are initialized on PowerPC platforms. Signed-off-by: Pavel Tatashin Reviewed-by: Shannon Nelson --- arch/powerpc/mm/init_64.c |2 +- 1 files changed, 1 insertions(+), 1 d

[PATCH v7 10/11] arm64/kasan: explicitly zero kasan shadow memory

2017-08-28 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. We must explicitly zero the memory that is allocated by vmemmap_populate() for kasan, as this memory does not go through struct page initialization path. Signed-off-by: Pavel Tatashin

[PATCH v7 07/11] sparc64: optimized struct page zeroing

2017-08-28 Thread Pavel Tatashin
is a fixed time: it does not increase as memory is increased. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- arch/sparc/include/asm/pgtable_64.h | 30 ++ 1 file changed, 30 insertions(+) diff --g

[PATCH v7 02/11] sparc64/mm: setting fields in deferred pages

2017-08-28 Thread Pavel Tatashin
fore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- arch/sparc/mm/init_64.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/sparc/mm/init_64.c b/arch/sparc

[PATCH v7 04/11] sparc64: simplify vmemmap_populate

2017-08-28 Thread Pavel Tatashin
Remove duplicating code by using common functions vmemmap_pud_populate and vmemmap_pgd_populate. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- arch/sparc/mm/init_64.c | 23 ++- 1 file changed, 6 insertions

[PATCH v7 01/11] x86/mm: setting fields in deferred pages

2017-08-28 Thread Pavel Tatashin
at struct pages are properly initialized prior to using them. The deferred-reserved pages are initialized in free_all_bootmem(). Therefore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- arch/x

[PATCH v7 09/11] x86/kasan: explicitly zero kasan shadow memory

2017-08-28 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. We must explicitly zero the memory that is allocated by vmemmap_populate() for kasan, as this memory does not go through struct page initialization path. Signed-off-by: Pavel Tatashin

[PATCH v7 00/11] complete deferred page initialization

2017-08-28 Thread Pavel Tatashin
no deferred: https://hastebin.com/muhegoheyi.go sparc fix deferred: https://hastebin.com/xadinobutu.go Pavel Tatashin (11): x86/mm: setting fields in deferred pages sparc64/mm: setting fields in deferred pages mm: deferred_init_memmap improvements sparc64: simplify vmemmap_pop

[PATCH v7 08/11] mm: zero reserved and unavailable struct pages

2017-08-28 Thread Pavel Tatashin
uct pages explicitly. The patch involves adding a new memblock iterator: for_each_resv_unavail_range(i, p_start, p_end) Which iterates through reserved && !memory lists, and we zero struct pages explicitly by calling mm_zero_struct_page(). Signed-off-by: Pavel Tatashin Reviewed

[PATCH v7 03/11] mm: deferred_init_memmap improvements

2017-08-28 Thread Pavel Tatashin
linux would get memory corruptions. I have fixed this issue by defining a new macro that performs all the necessary operations when we free the current set of pages. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by:

[PATCH v7 11/11] mm: stop zeroing memory during allocation in vmemmap

2017-08-28 Thread Pavel Tatashin
ement by zeroing the memory in parallel when struct pages are zeroed. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- include/linux/mm.h | 11 +++ mm/sparse-vmemmap.c | 14 +++--- mm/sparse.c | 6 +++--- 3

[PATCH v7 06/11] mm: zero struct pages during initialization

2017-08-28 Thread Pavel Tatashin
called from zone_sizes_init(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Michal Hocko --- include/linux/mm.h | 9 + mm/page_alloc.c| 1 + 2 files changed, 10 insertions(+) diff --git a/include/linux/mm.h b

[PATCH v7 05/11] mm: defining memblock_virt_alloc_try_nid_raw

2017-08-28 Thread Pavel Tatashin
r raw alloctor When CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is returned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no places excpect zeroed memory. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Ack

[PATCH v8 01/11] x86/mm: setting fields in deferred pages

2017-09-14 Thread Pavel Tatashin
at struct pages are properly initialized prior to using them. The deferred-reserved pages are initialized in free_all_bootmem(). Therefore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- arch/x

[PATCH v8 06/11] mm: zero struct pages during initialization

2017-09-14 Thread Pavel Tatashin
called from zone_sizes_init(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Michal Hocko --- include/linux/mm.h | 9 + mm/page_alloc.c| 1 + 2 files changed, 10 insertions(+) diff --git a/include/linux/mm.h b

[PATCH v8 08/11] mm: zero reserved and unavailable struct pages

2017-09-14 Thread Pavel Tatashin
uct pages explicitly. The patch involves adding a new memblock iterator: for_each_resv_unavail_range(i, p_start, p_end) Which iterates through reserved && !memory lists, and we zero struct pages explicitly by calling mm_zero_struct_page(). Signed-off-by: Pavel Tatashin Reviewed

[PATCH v8 04/11] sparc64: simplify vmemmap_populate

2017-09-14 Thread Pavel Tatashin
Remove duplicating code by using common functions vmemmap_pud_populate and vmemmap_pgd_populate. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/mm/init_64.c | 23 ++- 1

[PATCH v8 11/11] mm: stop zeroing memory during allocation in vmemmap

2017-09-14 Thread Pavel Tatashin
ement by zeroing the memory in parallel when struct pages are zeroed. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- include/linux/mm.h | 11 +++ mm/sparse-vmemmap.c | 15 +++ mm/sparse.c | 6 +++-

[PATCH v8 03/11] mm: deferred_init_memmap improvements

2017-09-14 Thread Pavel Tatashin
linux would get memory corruptions. I have fixed this issue by defining a new macro that performs all the necessary operations when we free the current set of pages. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by:

[PATCH v8 10/11] arm64/kasan: explicitly zero kasan shadow memory

2017-09-14 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. We must explicitly zero the memory that is allocated by vmemmap_populate() for kasan, as this memory does not go through struct page initialization path. Signed-off-by: Pavel Tatashin

[PATCH v8 05/11] mm: defining memblock_virt_alloc_try_nid_raw

2017-09-14 Thread Pavel Tatashin
r raw alloctor When CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is returned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no places excpect zeroed memory. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Ack

[PATCH v8 09/11] x86/kasan: explicitly zero kasan shadow memory

2017-09-14 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. We must explicitly zero the memory that is allocated by vmemmap_populate() for kasan, as this memory does not go through struct page initialization path. Signed-off-by: Pavel Tatashin

[PATCH v8 07/11] sparc64: optimized struct page zeroing

2017-09-14 Thread Pavel Tatashin
is a fixed time: it does not increase as memory is increased. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/include/asm/pgtable_64.h | 30 ++ 1 file changed

[PATCH v8 02/11] sparc64/mm: setting fields in deferred pages

2017-09-14 Thread Pavel Tatashin
fore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/mm/init_64.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/sparc/

[PATCH v7 00/11] complete deferred page initialization

2017-09-14 Thread Pavel Tatashin
la sparc base no deferred: https://hastebin.com/ibobeteken.go sparc base deferred: https://hastebin.com/fariqimiyu.go sparc fix no deferred: https://hastebin.com/muhegoheyi.go sparc fix deferred: https://hastebin.com/xadinobutu.go Pavel Tatashin (11): x86/mm: setting fields in de

[PATCH v8 00/11] complete deferred page initialization

2017-09-14 Thread Pavel Tatashin
Copy paste error, changing the subject for the header to v8 from v7. On 09/14/2017 06:35 PM, Pavel Tatashin wrote: Changelog: v8 - v7 - Added Acked-by's from Dave Miller for SPARC changes - Fixed a minor compiling issue on tile architecture reported by kbuild v7 - v6 - Addressed comments

Re: [PATCH v8 10/11] arm64/kasan: explicitly zero kasan shadow memory

2017-09-14 Thread Pavel Tatashin
Hi Mark, Thank you for looking at this. We can't do this because page table is not set until cpu_replace_ttbr1() is called. So, we can't do memset() on this memory until then. Pasha

Re: [PATCH v8 10/11] arm64/kasan: explicitly zero kasan shadow memory

2017-09-15 Thread Pavel Tatashin
ject, than sure I can send a new version with kasanmap_populate() functions. Thank you, Pasha On 09/15/2017 04:38 PM, Mark Rutland wrote: On Thu, Sep 14, 2017 at 09:30:28PM -0400, Pavel Tatashin wrote: Hi Mark, Thank you for looking at this. We can't do this because page table i

[PATCH v9 04/12] sparc64: simplify vmemmap_populate

2017-09-20 Thread Pavel Tatashin
Remove duplicating code by using common functions vmemmap_pud_populate and vmemmap_pgd_populate. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/mm/init_64.c | 23 ++- 1

[PATCH v9 00/12] complete deferred page initialization

2017-09-20 Thread Pavel Tatashin
m/fariqimiyu.go sparc fix no deferred: https://hastebin.com/muhegoheyi.go sparc fix deferred: https://hastebin.com/xadinobutu.go Pavel Tatashin (12): x86/mm: setting fields in deferred pages sparc64/mm: setting fields in deferred pages mm: deferred_init_memmap improvements sparc64:

[PATCH v9 01/12] x86/mm: setting fields in deferred pages

2017-09-20 Thread Pavel Tatashin
at struct pages are properly initialized prior to using them. The deferred-reserved pages are initialized in free_all_bootmem(). Therefore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- arch/x

[PATCH v9 02/12] sparc64/mm: setting fields in deferred pages

2017-09-20 Thread Pavel Tatashin
fore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/mm/init_64.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/sparc/

[PATCH v9 07/12] sparc64: optimized struct page zeroing

2017-09-20 Thread Pavel Tatashin
is a fixed time: it does not increase as memory is increased. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/include/asm/pgtable_64.h | 30 ++ 1 file changed

[PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-09-20 Thread Pavel Tatashin
ulate() function to resolve this difference. Signed-off-by: Pavel Tatashin --- arch/arm64/include/asm/pgtable.h | 3 ++ include/linux/kasan.h| 2 ++ mm/kasan/kasan_init.c| 67 3 files changed, 72 insertions(+) diff --git a/arch/

[PATCH v9 10/12] x86/kasan: use kasan_map_populate()

2017-09-20 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/x86/mm/kasan_init_64.c | 8

[PATCH v9 03/12] mm: deferred_init_memmap improvements

2017-09-20 Thread Pavel Tatashin
linux would get memory corruptions. I have fixed this issue by defining a new macro that performs all the necessary operations when we free the current set of pages. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by:

[PATCH v9 08/12] mm: zero reserved and unavailable struct pages

2017-09-20 Thread Pavel Tatashin
uct pages explicitly. The patch involves adding a new memblock iterator: for_each_resv_unavail_range(i, p_start, p_end) Which iterates through reserved && !memory lists, and we zero struct pages explicitly by calling mm_zero_struct_page(). Signed-off-by: Pavel Tatashin Reviewed

[PATCH v9 05/12] mm: defining memblock_virt_alloc_try_nid_raw

2017-09-20 Thread Pavel Tatashin
r raw alloctor When CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is returned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no places excpect zeroed memory. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Ack

[PATCH v9 12/12] mm: stop zeroing memory during allocation in vmemmap

2017-09-20 Thread Pavel Tatashin
ement by zeroing the memory in parallel when struct pages are zeroed. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- include/linux/mm.h | 11 +++ mm/sparse-vmemmap.c | 15 +++ mm/sparse.c | 6 +++-

[PATCH v9 11/12] arm64/kasan: use kasan_map_populate()

2017-09-20 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/arm64/mm/kasan_init.c | 12

[PATCH v9 06/12] mm: zero struct pages during initialization

2017-09-20 Thread Pavel Tatashin
called from zone_sizes_init(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Michal Hocko --- include/linux/mm.h | 9 + mm/page_alloc.c| 1 + 2 files changed, 10 insertions(+) diff --git a/include/linux/mm.h b

[PATCH] mm: deferred_init_memmap improvements

2017-10-04 Thread Pavel Tatashin
when we free the current set of pages. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- mm/page_alloc.c | 168 1 file changed, 85 insertions(+), 83 deletions(-) diff --g

[PATCH v10 01/10] x86/mm: setting fields in deferred pages

2017-10-05 Thread Pavel Tatashin
at struct pages are properly initialized prior to using them. The deferred-reserved pages are initialized in free_all_bootmem(). Therefore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Mich

[PATCH v10 00/10] complete deferred page initialization

2017-10-05 Thread Pavel Tatashin
deferred: https://hastebin.com/ibobeteken.go sparc base deferred: https://hastebin.com/fariqimiyu.go sparc fix no deferred: https://hastebin.com/muhegoheyi.go sparc fix deferred: https://hastebin.com/xadinobutu.go Pavel Tatashin (10): x86/mm: setting fields in deferred pages

[PATCH v10 03/10] sparc64: simplify vmemmap_populate

2017-10-05 Thread Pavel Tatashin
Remove duplicating code by using common functions vmemmap_pud_populate and vmemmap_pgd_populate. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller Acked-by: Michal Hocko --- arch/sparc/mm/init_64.c | 23

[PATCH v10 05/10] mm: zero reserved and unavailable struct pages

2017-10-05 Thread Pavel Tatashin
end) Which iterates through reserved && !memory lists, and we zero struct pages explicitly by calling mm_zero_struct_page(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- include/linux/memblock.h | 16 include

[PATCH v10 07/10] x86/kasan: use kasan_map_populate()

2017-10-05 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/x86/mm/kasan_init_64.c | 8

[PATCH v10 02/10] sparc64/mm: setting fields in deferred pages

2017-10-05 Thread Pavel Tatashin
fore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller Acked-by: Michal Hocko --- arch/sparc/mm/init_64.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-)

[PATCH v10 09/10] mm: stop zeroing memory during allocation in vmemmap

2017-10-05 Thread Pavel Tatashin
rt is moved later in this patch into __init_single_page(), which is called from zone_sizes_init(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Michal Hocko --- include/linux/mm.h | 11 +++ mm/page_alloc.c

[PATCH v10 04/10] mm: defining memblock_virt_alloc_try_nid_raw

2017-10-05 Thread Pavel Tatashin
r raw alloctor When CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is returned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no places excpect zeroed memory. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Ack

[PATCH v10 06/10] mm/kasan: kasan specific map populate function

2017-10-05 Thread Pavel Tatashin
ulate() function to resolve this difference. Signed-off-by: Pavel Tatashin --- arch/arm64/include/asm/pgtable.h | 3 ++ include/linux/kasan.h| 2 ++ mm/kasan/kasan_init.c| 67 3 files changed, 72 insertions(+) diff --git a/arch/

[PATCH v10 08/10] arm64/kasan: use kasan_map_populate()

2017-10-05 Thread Pavel Tatashin
To optimize the performance of struct page initialization, vmemmap_populate() will no longer zero memory. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/arm64/mm/kasan_init.c | 12

[PATCH v10 10/10] sparc64: optimized struct page zeroing

2017-10-05 Thread Pavel Tatashin
is a fixed time: it does not increase as memory is increased. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/include/asm/pgtable_64.h | 30 ++ 1 file changed

Re: [PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-10-09 Thread Pavel Tatashin
100, Mark Rutland wrote: >> On Wed, Sep 20, 2017 at 04:17:11PM -0400, Pavel Tatashin wrote: >> > During early boot, kasan uses vmemmap_populate() to establish its shadow >> > memory. But, that interface is intended for struct pages use. >> > >> > Because of

Re: [PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-10-09 Thread Pavel Tatashin
Hi Will, In addition to what Michal wrote: > As an interim step, why not introduce something like > vmemmap_alloc_block_flags and make the page-table walking opt-out for > architectures that don't want it? Then we can just pass __GFP_ZERO from > our vmemmap_populate where necessary and other arch

Re: [PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-10-09 Thread Pavel Tatashin
Hi Will, > We have two table walks even with your patch series applied afaict: one in > our definition of vmemmap_populate (arch/arm64/mm/mmu.c) and this one > in the core code. I meant to say implementing two new page table walkers, not at runtime. > My worry is that these are actually highly a

Re: [PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-10-09 Thread Pavel Tatashin
> > Ok, but I'm still missing why you think that is needed. What would be the > second page table walker that needs implementing? > > I guess we could implement that on arm64 using our current vmemmap_populate > logic and an explicit memset. > Hi Will, What do you mean by explicit memset()? We ca

Re: [PATCH v9 09/12] mm/kasan: kasan specific map populate function

2017-10-09 Thread Pavel Tatashin
>> I guess we could implement that on arm64 using our current vmemmap_populate >> logic and an explicit memset. Hi Will, I will send out a new patch series with x86/arm64 versions of kasan_map_populate(), so you could take a look if this is something that is acceptable. Thank you, Pavel

[PATCH v11 1/9] x86/mm: setting fields in deferred pages

2017-10-09 Thread Pavel Tatashin
at struct pages are properly initialized prior to using them. The deferred-reserved pages are initialized in free_all_bootmem(). Therefore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Mich

[PATCH v11 7/9] arm64/kasan: add and use kasan_map_populate()

2017-10-09 Thread Pavel Tatashin
ulate() function to resolve this difference. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/arm64/mm/kasan_init.c | 72 ++ 1 file changed, 66 insertions(

[PATCH v11 3/9] sparc64: simplify vmemmap_populate

2017-10-09 Thread Pavel Tatashin
Remove duplicating code by using common functions vmemmap_pud_populate and vmemmap_pgd_populate. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller Acked-by: Michal Hocko --- arch/sparc/mm/init_64.c | 23

[PATCH v11 9/9] sparc64: optimized struct page zeroing

2017-10-09 Thread Pavel Tatashin
is a fixed time: it does not increase as memory is increased. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller --- arch/sparc/include/asm/pgtable_64.h | 30 ++ 1 file changed

[PATCH v11 4/9] mm: defining memblock_virt_alloc_try_nid_raw

2017-10-09 Thread Pavel Tatashin
r raw alloctor When CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is returned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no places excpect zeroed memory. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Ack

[PATCH v11 8/9] mm: stop zeroing memory during allocation in vmemmap

2017-10-09 Thread Pavel Tatashin
rt is moved later in this patch into __init_single_page(), which is called from zone_sizes_init(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: Michal Hocko --- include/linux/mm.h | 11 +++ mm/page_alloc.c

[PATCH v11 0/9] complete deferred page initialization

2017-10-09 Thread Pavel Tatashin
rred: https://hastebin.com/fariqimiyu.go sparc fix no deferred: https://hastebin.com/muhegoheyi.go sparc fix deferred: https://hastebin.com/xadinobutu.go Pavel Tatashin (9): x86/mm: setting fields in deferred pages sparc64/mm: setting fields in deferred pages sparc64: simplify

[PATCH v11 6/9] x86/kasan: add and use kasan_map_populate()

2017-10-09 Thread Pavel Tatashin
ulate() function to resolve this difference. Therefore, we must use a new interface to allocate and map kasan shadow memory, that also zeroes memory for us. Signed-off-by: Pavel Tatashin --- arch/x86/mm/kasan_init_64.c | 75 ++--- 1 file changed, 71 insertions(

[PATCH v11 2/9] sparc64/mm: setting fields in deferred pages

2017-10-09 Thread Pavel Tatashin
fore, the fix is to switch the above calls. Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco Acked-by: David S. Miller Acked-by: Michal Hocko --- arch/sparc/mm/init_64.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-)

[PATCH v11 5/9] mm: zero reserved and unavailable struct pages

2017-10-09 Thread Pavel Tatashin
end) Which iterates through reserved && !memory lists, and we zero struct pages explicitly by calling mm_zero_struct_page(). Signed-off-by: Pavel Tatashin Reviewed-by: Steven Sistare Reviewed-by: Daniel Jordan Reviewed-by: Bob Picco --- include/linux/memblock.h | 16 include

Re: [PATCH v11 5/9] mm: zero reserved and unavailable struct pages

2017-10-10 Thread Pavel Tatashin
> Btw. I would add your example from > http://lkml.kernel.org/r/bcf24369-ac37-cedd-a264-3396fb5cf...@oracle.com > to do changelog > Will add, thank you for your review. Pavel

Re: [PATCH v11 7/9] arm64/kasan: add and use kasan_map_populate()

2017-10-10 Thread Pavel Tatashin
Hi Will, Thank you for doing this work. How would you like to proceed? - If you OK for my series to be accepted as-is, so your patch can be added later on top, I think, I need an ack from you for kasan changes. - Otherwise, I can replace: 4267aaf1d279 arm64/kasan: add and use kasan_map_populate()

Re: [PATCH v11 0/9] complete deferred page initialization

2017-10-10 Thread Pavel Tatashin
I wanted to thank you Michal for spending time and doing the in-depth reviews of every incremental change. Overall the series is in much better shape now because of your feedback. Pavel On 10/10/2017 10:15 AM, Michal Hocko wrote: Btw. thanks for your persistance and willingness to go over all

Re: [PATCH v11 7/9] arm64/kasan: add and use kasan_map_populate()

2017-10-10 Thread Pavel Tatashin
Hi Will, Ok, I will add your patch at the end of my series. Thank you, Pavel > > I was thinking that you could just add my patch to the end of your series > and have the whole lot go up like that. If you want to merge it with your > patch, I'm fine with that too. > > Will > > -- > To unsubscribe

  1   2   >