[PATCH v13 18/18] sched: use static key for sched_clock_running

2018-07-11 Thread Pavel Tatashin
sched_clock_running may be read every time sched_clock_cpu() is called. Yet, this variable is updated only twice during boot, and never changes again, therefore it is better to make it a static key. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 16 kernel/sched

[PATCH v13 15/18] x86/tsc: use tsc early

2018-07-11 Thread Pavel Tatashin
is known from as early as when tsc_early_init() is called. Use the early tsc calibration to output timestamps early. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 0b1abe7fdd8e

[PATCH v13 15/18] x86/tsc: use tsc early

2018-07-11 Thread Pavel Tatashin
is known from as early as when tsc_early_init() is called. Use the early tsc calibration to output timestamps early. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 0b1abe7fdd8e

[PATCH v13 05/18] kvm/x86: remove kvm memblock dependency

2018-07-11 Thread Pavel Tatashin
availability of TSC. - remove dependency on memblock, and reduce code - earlier kvm sched_clock() Signed-off-by: Pavel Tatashin Reviewed-by: Thomas Gleixner --- arch/x86/include/asm/kvm_para.h | 2 +- arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/kvmclock.c | 66

[PATCH v13 07/18] x86/xen/time: output xen sched_clock time from 0

2018-07-11 Thread Pavel Tatashin
It is expected for sched_clock() to output data from 0, when system boots. Add an offset xen_sched_clock_offset (similarly how it is done in other hypervisors i.e. kvm_sched_clock_offset) to count sched_clock() from 0, when time is first initialized. Signed-off-by: Pavel Tatashin --- arch/x86

[PATCH v13 05/18] kvm/x86: remove kvm memblock dependency

2018-07-11 Thread Pavel Tatashin
availability of TSC. - remove dependency on memblock, and reduce code - earlier kvm sched_clock() Signed-off-by: Pavel Tatashin Reviewed-by: Thomas Gleixner --- arch/x86/include/asm/kvm_para.h | 2 +- arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/kvmclock.c | 66

[PATCH v13 07/18] x86/xen/time: output xen sched_clock time from 0

2018-07-11 Thread Pavel Tatashin
It is expected for sched_clock() to output data from 0, when system boots. Add an offset xen_sched_clock_offset (similarly how it is done in other hypervisors i.e. kvm_sched_clock_offset) to count sched_clock() from 0, when time is first initialized. Signed-off-by: Pavel Tatashin --- arch/x86

[PATCH v13 02/18] x86: initialize static branching early

2018-07-11 Thread Pavel Tatashin
functionality early as well. static branching requires patching nop instructions, thus, we need arch_init_ideal_nops() to be called prior to jump_label_init() Here we do all the necessary steps to call arch_init_ideal_nops after early_cpu_init(). Signed-off-by: Pavel Tatashin Suggested-by: Peter

[PATCH v13 09/18] time: replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

2018-07-11 Thread Pavel Tatashin
by read_persistent_clock() And boot_offset is wall_time - boot time, which defaults to 0. Signed-off-by: Pavel Tatashin --- include/linux/timekeeping.h | 3 +- kernel/time/timekeeping.c | 59 +++-- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/linux

[PATCH v13 02/18] x86: initialize static branching early

2018-07-11 Thread Pavel Tatashin
functionality early as well. static branching requires patching nop instructions, thus, we need arch_init_ideal_nops() to be called prior to jump_label_init() Here we do all the necessary steps to call arch_init_ideal_nops after early_cpu_init(). Signed-off-by: Pavel Tatashin Suggested-by: Peter

[PATCH v13 09/18] time: replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

2018-07-11 Thread Pavel Tatashin
by read_persistent_clock() And boot_offset is wall_time - boot time, which defaults to 0. Signed-off-by: Pavel Tatashin --- include/linux/timekeeping.h | 3 +- kernel/time/timekeeping.c | 59 +++-- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/linux

[PATCH v13 04/18] x86/tsc: redefine notsc to behave as tsc=unstable

2018-07-11 Thread Pavel Tatashin
value. This is why there is no reason to keep notsc, and it can be removed. But, for compatibility reasons we will keep this parameter but change its definition to be the same as tsc=unstable. Signed-off-by: Pavel Tatashin Reviewed-by: Dou Liyang Reviewed-by: Thomas Gleixner --- .../admin-guide

[PATCH v13 10/18] time: default boot time offset to local_clock()

2018-07-11 Thread Pavel Tatashin
but have early sched_clock(), such as SPARCv9, x86, and possibly more will benefit from this change by getting a better and more consistent estimate of the boot time without need for an arch specific implementation. Signed-off-by: Pavel Tatashin --- kernel/time/timekeeping.c | 7 +-- 1 file

[PATCH v13 04/18] x86/tsc: redefine notsc to behave as tsc=unstable

2018-07-11 Thread Pavel Tatashin
value. This is why there is no reason to keep notsc, and it can be removed. But, for compatibility reasons we will keep this parameter but change its definition to be the same as tsc=unstable. Signed-off-by: Pavel Tatashin Reviewed-by: Dou Liyang Reviewed-by: Thomas Gleixner --- .../admin-guide

[PATCH v13 10/18] time: default boot time offset to local_clock()

2018-07-11 Thread Pavel Tatashin
but have early sched_clock(), such as SPARCv9, x86, and possibly more will benefit from this change by getting a better and more consistent estimate of the boot time without need for an arch specific implementation. Signed-off-by: Pavel Tatashin --- kernel/time/timekeeping.c | 7 +-- 1 file

[PATCH v13 00/18] Early boot time stamps

2018-07-11 Thread Pavel Tatashin
: https://patchwork.kernel.org/patch/10021247/ - If early boot timestamps were available, the engineer who introduced this bug would have noticed the extra time that is spent early in boot. Pavel Tatashin (7): x86/tsc: remove tsc_disabled flag time: sync read_boot_clock64() with persistent clock

[PATCH v13 11/18] s390/time: remove read_boot_clock64()

2018-07-11 Thread Pavel Tatashin
read_boot_clock64() was replaced by read_persistent_wall_and_boot_offset() so remove it. Signed-off-by: Pavel Tatashin --- arch/s390/kernel/time.c | 13 - 1 file changed, 13 deletions(-) diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index d1f5447d5687..e8766beee5ad

[PATCH v13 03/18] x86/CPU: Call detect_nopl() only on the BSP

2018-07-11 Thread Pavel Tatashin
-by: Pavel Tatashin --- arch/x86/kernel/cpu/common.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 71281ac43b15..46408a8cdf62 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c

[PATCH v13 06/18] x86/xen/time: initialize pv xen time in init_hypervisor_platform

2018-07-11 Thread Pavel Tatashin
() call. 3. Re-initializing parts of shared info copy to xen_pv_post_suspend() to be symmetric to xen_pv_pre_suspend Also, remove code duplications by calling xen_init_time_ops() from xen_hvm_init_time_ops(). Signed-off-by: Pavel Tatashin --- arch/x86/xen/enlighten_pv.c | 51

[PATCH v13 08/18] s390/time: add read_persistent_wall_and_boot_offset()

2018-07-11 Thread Pavel Tatashin
of read_persistent_clock64() Signed-off-by: Pavel Tatashin Reviewed-by: Martin Schwidefsky --- arch/s390/kernel/time.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index cf561160ea88..d1f5447d5687 100644 --- a/arch/s390/kernel/time.c +++ b

[PATCH v13 08/18] s390/time: add read_persistent_wall_and_boot_offset()

2018-07-11 Thread Pavel Tatashin
of read_persistent_clock64() Signed-off-by: Pavel Tatashin Reviewed-by: Martin Schwidefsky --- arch/s390/kernel/time.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index cf561160ea88..d1f5447d5687 100644 --- a/arch/s390/kernel/time.c +++ b

[PATCH v13 00/18] Early boot time stamps

2018-07-11 Thread Pavel Tatashin
: https://patchwork.kernel.org/patch/10021247/ - If early boot timestamps were available, the engineer who introduced this bug would have noticed the extra time that is spent early in boot. Pavel Tatashin (7): x86/tsc: remove tsc_disabled flag time: sync read_boot_clock64() with persistent clock

[PATCH v13 11/18] s390/time: remove read_boot_clock64()

2018-07-11 Thread Pavel Tatashin
read_boot_clock64() was replaced by read_persistent_wall_and_boot_offset() so remove it. Signed-off-by: Pavel Tatashin --- arch/s390/kernel/time.c | 13 - 1 file changed, 13 deletions(-) diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index d1f5447d5687..e8766beee5ad

[PATCH v13 03/18] x86/CPU: Call detect_nopl() only on the BSP

2018-07-11 Thread Pavel Tatashin
-by: Pavel Tatashin --- arch/x86/kernel/cpu/common.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 71281ac43b15..46408a8cdf62 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c

[PATCH v13 06/18] x86/xen/time: initialize pv xen time in init_hypervisor_platform

2018-07-11 Thread Pavel Tatashin
() call. 3. Re-initializing parts of shared info copy to xen_pv_post_suspend() to be symmetric to xen_pv_pre_suspend Also, remove code duplications by calling xen_init_time_ops() from xen_hvm_init_time_ops(). Signed-off-by: Pavel Tatashin --- arch/x86/xen/enlighten_pv.c | 51

[PATCH v13 17/18] sched: early boot clock

2018-07-11 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() is called. This provides with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- init/main.c | 2 +- kernel/sched/clock.c | 10 +- 2 files changed, 10 insertions(+), 2

[PATCH v13 17/18] sched: early boot clock

2018-07-11 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() is called. This provides with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- init/main.c | 2 +- kernel/sched/clock.c | 10 +- 2 files changed, 10 insertions(+), 2

[PATCH v13 12/18] ARM/time: remove read_boot_clock64()

2018-07-11 Thread Pavel Tatashin
-by: Pavel Tatashin --- arch/arm/include/asm/mach/time.h| 3 +-- arch/arm/kernel/time.c | 15 ++- arch/arm/plat-omap/counter_32k.c| 2 +- drivers/clocksource/tegra20_timer.c | 2 +- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/arch/arm/include

[PATCH v13 12/18] ARM/time: remove read_boot_clock64()

2018-07-11 Thread Pavel Tatashin
-by: Pavel Tatashin --- arch/arm/include/asm/mach/time.h| 3 +-- arch/arm/kernel/time.c | 15 ++- arch/arm/plat-omap/counter_32k.c| 2 +- drivers/clocksource/tegra20_timer.c | 2 +- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/arch/arm/include

[PATCH v13 14/18] x86/tsc: initialize cyc2ns when tsc freq. is determined

2018-07-11 Thread Pavel Tatashin
set_cyc2ns_scale() can be called when system is up, and wraps around __set_cyc2ns_scale() that can be called directly when system is booting but avoids saving restoring IRQs and going and waking up from idle. Suggested-by: Thomas Gleixner Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c

[PATCH v13 14/18] x86/tsc: initialize cyc2ns when tsc freq. is determined

2018-07-11 Thread Pavel Tatashin
set_cyc2ns_scale() can be called when system is up, and wraps around __set_cyc2ns_scale() that can be called directly when system is booting but avoids saving restoring IRQs and going and waking up from idle. Suggested-by: Thomas Gleixner Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c

Re: [PATCH v4 0/3] sparse_init rewrite

2018-07-09 Thread Pavel Tatashin
On Mon, Jul 9, 2018 at 5:29 PM Andrew Morton wrote: > > On Mon, 9 Jul 2018 13:53:09 -0400 Pavel Tatashin > wrote: > > > In sparse_init() we allocate two large buffers to temporary hold usemap and > > memmap for the whole machine. However, we can avoid doing that if we

Re: [PATCH v4 0/3] sparse_init rewrite

2018-07-09 Thread Pavel Tatashin
On Mon, Jul 9, 2018 at 5:29 PM Andrew Morton wrote: > > On Mon, 9 Jul 2018 13:53:09 -0400 Pavel Tatashin > wrote: > > > In sparse_init() we allocate two large buffers to temporary hold usemap and > > memmap for the whole machine. However, we can avoid doing that if we

[PATCH v4 2/3] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-09 Thread Pavel Tatashin
Change sprase_init() to only find the pnum ranges that belong to a specific node and call sprase_init_nid() for that range from sparse_init(). Delete all the code that became obsolete with this change. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- include/linux/mm.h | 5

[PATCH v4 2/3] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-09 Thread Pavel Tatashin
Change sprase_init() to only find the pnum ranges that belong to a specific node and call sprase_init_nid() for that range from sparse_init(). Delete all the code that became obsolete with this change. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- include/linux/mm.h | 5

[PATCH v4 3/3] mm/sparse: refactor sparse vmemmap buffer allocations

2018-07-09 Thread Pavel Tatashin
by introducing three functions to handle the global buffer: vmemmap_buffer_init() initialize the buffer vmemmap_buffer_fini() free the remaining part of the buffer vmemmap_buffer_alloc() alloc from the buffer, and if buffer is empty return NULL Signed-off-by: Pavel Tatashin --- mm/sparse

[PATCH v4 3/3] mm/sparse: refactor sparse vmemmap buffer allocations

2018-07-09 Thread Pavel Tatashin
by introducing three functions to handle the global buffer: vmemmap_buffer_init() initialize the buffer vmemmap_buffer_fini() free the remaining part of the buffer vmemmap_buffer_alloc() alloc from the buffer, and if buffer is empty return NULL Signed-off-by: Pavel Tatashin --- mm/sparse

[PATCH v4 1/3] mm/sparse: add sparse_init_nid()

2018-07-09 Thread Pavel Tatashin
either in large contiguous block or allocates section by section. This eliminates the need for use of temporary buffers. For simplified bisecting and review, the new interface is going to be enabled as well as old code removed in the next patch. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar

[PATCH v4 1/3] mm/sparse: add sparse_init_nid()

2018-07-09 Thread Pavel Tatashin
either in large contiguous block or allocates section by section. This eliminates the need for use of temporary buffers. For simplified bisecting and review, the new interface is going to be enabled as well as old code removed in the next patch. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar

[PATCH v4 0/3] sparse_init rewrite

2018-07-09 Thread Pavel Tatashin
. These patches should be applied on top of Baoquan's work, as CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (3): mm

[PATCH v4 0/3] sparse_init rewrite

2018-07-09 Thread Pavel Tatashin
. These patches should be applied on top of Baoquan's work, as CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (3): mm

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-09 Thread Pavel Tatashin
On Thu, Jul 5, 2018 at 9:39 AM Dave Hansen wrote: > > On 07/02/2018 01:29 PM, Pavel Tatashin wrote: > > On Mon, Jul 2, 2018 at 4:00 PM Dave Hansen wrote: > >>> + unsigned long size = sizeof(struct page) * PAGES_PER_SECTION; > >>> + unsigned long p

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-09 Thread Pavel Tatashin
On Thu, Jul 5, 2018 at 9:39 AM Dave Hansen wrote: > > On 07/02/2018 01:29 PM, Pavel Tatashin wrote: > > On Mon, Jul 2, 2018 at 4:00 PM Dave Hansen wrote: > >>> + unsigned long size = sizeof(struct page) * PAGES_PER_SECTION; > >>> + unsigned long p

Re: [PATCH v12 04/11] kvm/x86: remove kvm memblock dependency

2018-07-06 Thread Pavel Tatashin
I think using __initdata during init_hypervisor_platform() + allocating during x86_init.hyper.guest_late_init() is a good approach. My only concern, it would mean we need to init/uinit/init clock for boot cpu. Does it mean the clock continuity is preserved during the transition? I believe so, but

Re: [PATCH v12 04/11] kvm/x86: remove kvm memblock dependency

2018-07-06 Thread Pavel Tatashin
I think using __initdata during init_hypervisor_platform() + allocating during x86_init.hyper.guest_late_init() is a good approach. My only concern, it would mean we need to init/uinit/init clock for boot cpu. Does it mean the clock continuity is preserved during the transition? I believe so, but

Re: [PATCH] mm/memblock: replace u64 with phys_addr_t where appropriate

2018-07-03 Thread Pavel Tatashin
ral format strings from %llx to %pa to avoid casting from > phys_addr_t to u64. > > CC: Michal Hocko > CC: Matthew Wilcox > Signed-off-by: Mike Rapoport Looks good. Reviewed-by: Pavel Tatashin One minor thing that I would like to change in memblock.c is the useage p

Re: [PATCH] mm/memblock: replace u64 with phys_addr_t where appropriate

2018-07-03 Thread Pavel Tatashin
ral format strings from %llx to %pa to avoid casting from > phys_addr_t to u64. > > CC: Michal Hocko > CC: Matthew Wilcox > Signed-off-by: Mike Rapoport Looks good. Reviewed-by: Pavel Tatashin One minor thing that I would like to change in memblock.c is the useage p

Re: [PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-02 Thread Pavel Tatashin
Can you put it into memblock.c > Do you think it looks ok if I add the inline prefix? I would say no, this function is a too complex, and is not in some critical path to be always inlined. I would put it into memblock.c, and have #ifdef CONFIG_HAVE_MEMBLOCK_PFN_VALID around it. Thank you,

Re: [PATCH v9 2/6] mm: page_alloc: remain memblock_next_valid_pfn() on arm/arm64

2018-07-02 Thread Pavel Tatashin
Can you put it into memblock.c > Do you think it looks ok if I add the inline prefix? I would say no, this function is a too complex, and is not in some critical path to be always inlined. I would put it into memblock.c, and have #ifdef CONFIG_HAVE_MEMBLOCK_PFN_VALID around it. Thank you,

Re: [PATCH v3] x86/e820: put !E820_TYPE_RAM regions into memblock.reserved

2018-07-02 Thread Pavel Tatashin
> http://ozlabs.org/~akpm/mmots/broken-out/mm-skip-invalid-pages-block-at-a-time-in-zero_resv_unresv.patch > has been in -mm since Jun 18, so all is well. Ah missed it. Thank you. Pavel

Re: [PATCH v3] x86/e820: put !E820_TYPE_RAM regions into memblock.reserved

2018-07-02 Thread Pavel Tatashin
> http://ozlabs.org/~akpm/mmots/broken-out/mm-skip-invalid-pages-block-at-a-time-in-zero_resv_unresv.patch > has been in -mm since Jun 18, so all is well. Ah missed it. Thank you. Pavel

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 4:00 PM Dave Hansen wrote: > > > @@ -2651,6 +2651,14 @@ void sparse_mem_maps_populate_node(struct page > > **map_map, > > unsigned long pnum_end, > > unsigned long map_count, > >

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 4:00 PM Dave Hansen wrote: > > > @@ -2651,6 +2651,14 @@ void sparse_mem_maps_populate_node(struct page > > **map_map, > > unsigned long pnum_end, > > unsigned long map_count, > >

Re: [PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 4:00 PM Dave Hansen wrote: > > On 07/02/2018 12:54 PM, Pavel Tatashin wrote: > > > > > > On 07/02/2018 03:47 PM, Dave Hansen wrote: > >> On 07/01/2018 07:04 PM, Pavel Tatashin wrote: > >>> + for_each_present_section_nr(pnum_beg

Re: [PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 4:00 PM Dave Hansen wrote: > > On 07/02/2018 12:54 PM, Pavel Tatashin wrote: > > > > > > On 07/02/2018 03:47 PM, Dave Hansen wrote: > >> On 07/01/2018 07:04 PM, Pavel Tatashin wrote: > >>> + for_each_present_section_nr(pnum_beg

Re: [PATCH v3] x86/e820: put !E820_TYPE_RAM regions into memblock.reserved

2018-07-02 Thread Pavel Tatashin
> So I expect this patch needs a cc:stable, which I'll add. > > The optimiation patch seems less important and I'd like to hold that > off for 4.19-rc1? Hi Andrew, Should I resend the optimization patch [1] once 4.18 is released, or will you include it, and I do not need to do anything? [1]

Re: [PATCH v3] x86/e820: put !E820_TYPE_RAM regions into memblock.reserved

2018-07-02 Thread Pavel Tatashin
> So I expect this patch needs a cc:stable, which I'll add. > > The optimiation patch seems less important and I'd like to hold that > off for 4.19-rc1? Hi Andrew, Should I resend the optimization patch [1] once 4.18 is released, or will you include it, and I do not need to do anything? [1]

Re: [PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-02 Thread Pavel Tatashin
On 07/02/2018 03:47 PM, Dave Hansen wrote: > On 07/01/2018 07:04 PM, Pavel Tatashin wrote: >> +for_each_present_section_nr(pnum_begin + 1, pnum_end) { >> +int nid = sparse_early_nid(__nr_to_section(pnum_end)); >> >> +

Re: [PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-02 Thread Pavel Tatashin
On 07/02/2018 03:47 PM, Dave Hansen wrote: > On 07/01/2018 07:04 PM, Pavel Tatashin wrote: >> +for_each_present_section_nr(pnum_begin + 1, pnum_end) { >> +int nid = sparse_early_nid(__nr_to_section(pnum_end)); >> >> +

Re: [PATCH] mm/sparse: Make sparse_init_one_section void and remove check

2018-07-02 Thread Pavel Tatashin
scar Salvador Thank you Oscar. Reviewed-by: Pavel Tatashin > --- > mm/sparse.c | 12 +++- > 1 file changed, 3 insertions(+), 9 deletions(-)

Re: [PATCH] mm/sparse: Make sparse_init_one_section void and remove check

2018-07-02 Thread Pavel Tatashin
scar Salvador Thank you Oscar. Reviewed-by: Pavel Tatashin > --- > mm/sparse.c | 12 +++- > 1 file changed, 3 insertions(+), 9 deletions(-)

[PATCH v2] mm: teach dump_page() to correctly output poisoned struct pages

2018-07-02 Thread Pavel Tatashin
() PageSlab(page) PF_POISONED_CHECK(page) VM_BUG_ON_PGFLAGS(PagePoisoned(page), page) dump_page() recursion loop. Fixes: f165b378bbdf ("mm: uninitialized struct page poisoning sanity checking") Signed-off-by: Pavel Tatashin Acked-by: Michal Hocko --- mm/de

[PATCH v2] mm: teach dump_page() to correctly output poisoned struct pages

2018-07-02 Thread Pavel Tatashin
() PageSlab(page) PF_POISONED_CHECK(page) VM_BUG_ON_PGFLAGS(PagePoisoned(page), page) dump_page() recursion loop. Fixes: f165b378bbdf ("mm: uninitialized struct page poisoning sanity checking") Signed-off-by: Pavel Tatashin Acked-by: Michal Hocko --- mm/de

Re: [PATCH] mm: teach dump_page() to correctly output poisoned struct pages

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 11:59 AM Michal Hocko wrote: > > On Mon 02-07-18 11:27:45, Pavel Tatashin wrote: > > If struct page is poisoned, and uninitialized access is detected via > > PF_POISONED_CHECK(page) dump_page() is called to output the page. But, > > the dump_page(

Re: [PATCH] mm: teach dump_page() to correctly output poisoned struct pages

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 11:59 AM Michal Hocko wrote: > > On Mon 02-07-18 11:27:45, Pavel Tatashin wrote: > > If struct page is poisoned, and uninitialized access is detected via > > PF_POISONED_CHECK(page) dump_page() is called to output the page. But, > > the dump_page(

Re: [PATCH v3 0/2] sparse_init rewrite

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 12:20 PM Dave Hansen wrote: > > On 07/01/2018 07:04 PM, Pavel Tatashin wrote: > > include/linux/mm.h | 9 +- > > mm/sparse-vmemmap.c | 44 --- > > mm/sparse.c | 279 +++- > > 3 files c

Re: [PATCH v3 0/2] sparse_init rewrite

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 12:20 PM Dave Hansen wrote: > > On 07/01/2018 07:04 PM, Pavel Tatashin wrote: > > include/linux/mm.h | 9 +- > > mm/sparse-vmemmap.c | 44 --- > > mm/sparse.c | 279 +++- > > 3 files c

[PATCH] mm: teach dump_page() to correctly output poisoned struct pages

2018-07-02 Thread Pavel Tatashin
() PageSlab(page) PF_POISONED_CHECK(page) VM_BUG_ON_PGFLAGS(PagePoisoned(page), page) dump_page() recursion loop. Fixes: f165b378bbdf ("mm: uninitialized struct page poisoning sanity checking") Signed-off-by: Pavel Tatashin --- mm/debug.c | 13 +++-- 1 file c

[PATCH] mm: teach dump_page() to correctly output poisoned struct pages

2018-07-02 Thread Pavel Tatashin
() PageSlab(page) PF_POISONED_CHECK(page) VM_BUG_ON_PGFLAGS(PagePoisoned(page), page) dump_page() recursion loop. Fixes: f165b378bbdf ("mm: uninitialized struct page poisoning sanity checking") Signed-off-by: Pavel Tatashin --- mm/debug.c | 13 +++-- 1 file c

Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 7:40 AM Michal Hocko wrote: > > On Fri 29-06-18 10:29:17, Jia He wrote: > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns > > where possible") tried to optimize the loop in memmap_init_zone(). But > > there is still some room for improvement. > >

Re: [PATCH v9 0/6] optimize memblock_next_valid_pfn and early_pfn_valid on arm and arm64

2018-07-02 Thread Pavel Tatashin
On Mon, Jul 2, 2018 at 7:40 AM Michal Hocko wrote: > > On Fri 29-06-18 10:29:17, Jia He wrote: > > Commit b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns > > where possible") tried to optimize the loop in memmap_init_zone(). But > > there is still some room for improvement. > >

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> > So, on the first failure, we even stop trying to populate other > > sections. No more memory to do so. > > This is the thing I worry about. In old sparse_mem_maps_populate_node() > you can see, when not present or failed to populate, just continue. This > is the main difference between yours

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> > So, on the first failure, we even stop trying to populate other > > sections. No more memory to do so. > > This is the thing I worry about. In old sparse_mem_maps_populate_node() > you can see, when not present or failed to populate, just continue. This > is the main difference between yours

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> > + if (!usemap) { > > + pr_err("%s: usemap allocation failed", __func__); > > Wondering if we can provide more useful information for better debugging > if failed. E.g here tell on what nid the usemap allocation failed. > > > +

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> > + if (!usemap) { > > + pr_err("%s: usemap allocation failed", __func__); > > Wondering if we can provide more useful information for better debugging > if failed. E.g here tell on what nid the usemap allocation failed. > > > +

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> Ah, yes, I misunderstood it, sorry for that. > > Then I have only one concern, for vmemmap case, if one section doesn't > succeed to populate its memmap, do we need to skip all the remaining > sections in that node? Yes, in sparse_populate_node() we have the following: 294 for (pnum =

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> Ah, yes, I misunderstood it, sorry for that. > > Then I have only one concern, for vmemmap case, if one section doesn't > succeed to populate its memmap, do we need to skip all the remaining > sections in that node? Yes, in sparse_populate_node() we have the following: 294 for (pnum =

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
On Sun, Jul 1, 2018 at 10:31 PM Baoquan He wrote: > > On 07/01/18 at 10:18pm, Pavel Tatashin wrote: > > > Here, I think it might be not right to jump to 'failed' directly if one > > > section of the node failed to populate memmap. I think the original code > > > i

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
On Sun, Jul 1, 2018 at 10:31 PM Baoquan He wrote: > > On 07/01/18 at 10:18pm, Pavel Tatashin wrote: > > > Here, I think it might be not right to jump to 'failed' directly if one > > > section of the node failed to populate memmap. I think the original code > > > i

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> Here, I think it might be not right to jump to 'failed' directly if one > section of the node failed to populate memmap. I think the original code > is only skipping the section which memmap failed to populate by marking > it as not present with "ms->section_mem_map = 0". > Hi Baoquan, Thank

Re: [PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
> Here, I think it might be not right to jump to 'failed' directly if one > section of the node failed to populate memmap. I think the original code > is only skipping the section which memmap failed to populate by marking > it as not present with "ms->section_mem_map = 0". > Hi Baoquan, Thank

[PATCH v3 0/2] sparse_init rewrite

2018-07-01 Thread Pavel Tatashin
work, as CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (2): mm/sparse: add sparse_init_nid() mm/sparse: start using

[PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
either in large contiguous block or allocates section by section. This eliminates the need for use of temporary buffers. For simplified bisecting and review, the new interface is going to be enabled as well as old code removed in the next patch. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar

[PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
Change sprase_init() to only find the pnum ranges that belong to a specific node and call sprase_init_nid() for that range from sparse_init(). Delete all the code that became obsolete with this change. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 5 - mm/sparse-vmemmap.c | 39

[PATCH v3 0/2] sparse_init rewrite

2018-07-01 Thread Pavel Tatashin
work, as CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (2): mm/sparse: add sparse_init_nid() mm/sparse: start using

[PATCH v3 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
either in large contiguous block or allocates section by section. This eliminates the need for use of temporary buffers. For simplified bisecting and review, the new interface is going to be enabled as well as old code removed in the next patch. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar

[PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
Change sprase_init() to only find the pnum ranges that belong to a specific node and call sprase_init_nid() for that range from sparse_init(). Delete all the code that became obsolete with this change. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 5 - mm/sparse-vmemmap.c | 39

Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
> > Yes, if they are equal at 501, 'continue' to for loop. If nid is not > equal to nid_begin, we execute sparse_init_nid(), here should it be that > nid_begin is the current node, nid is next node? Nevermind, I forgot about the continue, I will fix it. Thank you again! Pavel

Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
> > Yes, if they are equal at 501, 'continue' to for loop. If nid is not > equal to nid_begin, we execute sparse_init_nid(), here should it be that > nid_begin is the current node, nid is next node? Nevermind, I forgot about the continue, I will fix it. Thank you again! Pavel

Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
~~~ > Here, node id passed to sparse_init_nid() should be 'nid_begin', but not > 'nid'. When you found out the current section's 'nid' is diferent than > 'nid_begin', handle node 'nid_begin', then start to next node 'nid'. Thank you for reviewing this work. Here nid

Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
~~~ > Here, node id passed to sparse_init_nid() should be 'nid_begin', but not > 'nid'. When you found out the current section's 'nid' is diferent than > 'nid_begin', handle node 'nid_begin', then start to next node 'nid'. Thank you for reviewing this work. Here nid

Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
On Sun, Jul 1, 2018 at 9:34 PM Baoquan He wrote: > > Hi Pavel, > > On 06/29/18 at 11:09pm, Pavel Tatashin wrote: > > Change sprase_init() to only find the pnum ranges that belong to a specific > > node and call sprase_init_nid() for that range from sparse_init(). >

Re: [PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-07-01 Thread Pavel Tatashin
On Sun, Jul 1, 2018 at 9:34 PM Baoquan He wrote: > > Hi Pavel, > > On 06/29/18 at 11:09pm, Pavel Tatashin wrote: > > Change sprase_init() to only find the pnum ranges that belong to a specific > > node and call sprase_init_nid() for that range from sparse_init(). >

Re: [PATCH v2 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
On Sun, Jul 1, 2018 at 9:29 PM Baoquan He wrote: > > On 06/29/18 at 11:09pm, Pavel Tatashin wrote: > > sparse_init() requires to temporary allocate two large buffers: > > usemap_map and map_map. Baoquan He has identified that these buffers are so > > large that Linux

Re: [PATCH v2 1/2] mm/sparse: add sparse_init_nid()

2018-07-01 Thread Pavel Tatashin
On Sun, Jul 1, 2018 at 9:29 PM Baoquan He wrote: > > On 06/29/18 at 11:09pm, Pavel Tatashin wrote: > > sparse_init() requires to temporary allocate two large buffers: > > usemap_map and map_map. Baoquan He has identified that these buffers are so > > large that Linux

[PATCH v2 1/2] mm/sparse: add sparse_init_nid()

2018-06-29 Thread Pavel Tatashin
. For simplified bisecting and review, the new interface is going to be enabled as well as old code removed in the next patch. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- include/linux/mm.h | 8 mm/sparse-vmemmap.c | 49 mm/sparse.c | 91

[PATCH v2 1/2] mm/sparse: add sparse_init_nid()

2018-06-29 Thread Pavel Tatashin
. For simplified bisecting and review, the new interface is going to be enabled as well as old code removed in the next patch. Signed-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- include/linux/mm.h | 8 mm/sparse-vmemmap.c | 49 mm/sparse.c | 91

[PATCH v2 0/2] sparse_init rewrite

2018-06-29 Thread Pavel Tatashin
is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (2): mm/sparse: add sparse_init_nid() mm/sparse: start using sparse_init_nid(), and remove old code include/linux

[PATCH v2 2/2] mm/sparse: start using sparse_init_nid(), and remove old code

2018-06-29 Thread Pavel Tatashin
Change sprase_init() to only find the pnum ranges that belong to a specific node and call sprase_init_nid() for that range from sparse_init(). Delete all the code that became obsolete with this change. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 5 - mm/sparse-vmemmap.c | 39

[PATCH v2 0/2] sparse_init rewrite

2018-06-29 Thread Pavel Tatashin
is removed in that work. For the ease of review, I split this work so the first patch only adds new interfaces, the second patch enables them, and removes the old ones. Pavel Tatashin (2): mm/sparse: add sparse_init_nid() mm/sparse: start using sparse_init_nid(), and remove old code include/linux

<    5   6   7   8   9   10   11   12   13   14   >