[PATCH v14 05/25] x86/kvmclock: Mark variables __initdata and __ro_after_init

2018-07-17 Thread Pavel Tatashin
From: Thomas Gleixner The kvmclock parameter is init data and the other variables are not modified after init. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini --- arch/x86/kernel/kvmclock.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions

[PATCH v14 04/25] x86/kvmclock: Cleanup the code

2018-07-17 Thread Pavel Tatashin
in keeping it around. - Convert to pr_info() Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini --- arch/x86/kernel/kvmclock.c | 76 -- 1 file changed, 23 insertions(+), 53 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b

[PATCH v14 14/25] x86/xen/time: output xen sched_clock time from 0

2018-07-17 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 v14 12/25] x86/tsc: redefine notsc to behave as tsc=unstable

2018-07-17 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 v14 09/25] x86: text_poke() may access uninitialized struct pages

2018-07-17 Thread Pavel Tatashin
ialized during handover from memblock. Use text_poke_early() in static branching until early boot IRQs are enabled, at which time switch to text_poke. Also, ensure text_poke() is never invoked when unitialized memory access may happen by using: BUG_ON(!after_bootmem); assertion. Signed-off-by:

[PATCH v14 07/25] x86/kvmclock: Switch kvmclock data to a PER_CPU variable

2018-07-17 Thread Pavel Tatashin
-by: Pavel Tatashin Acked-by: Paolo Bonzini --- arch/x86/kernel/kvmclock.c | 99 -- 1 file changed, 62 insertions(+), 37 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 08e7726a5e62..ed170171fe49 100644 --- a/arch/x86/kernel

[PATCH v14 12/25] x86/tsc: redefine notsc to behave as tsc=unstable

2018-07-17 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 v14 09/25] x86: text_poke() may access uninitialized struct pages

2018-07-17 Thread Pavel Tatashin
ialized during handover from memblock. Use text_poke_early() in static branching until early boot IRQs are enabled, at which time switch to text_poke. Also, ensure text_poke() is never invoked when unitialized memory access may happen by using: BUG_ON(!after_bootmem); assertion. Signed-off-by:

[PATCH v14 07/25] x86/kvmclock: Switch kvmclock data to a PER_CPU variable

2018-07-17 Thread Pavel Tatashin
-by: Pavel Tatashin Acked-by: Paolo Bonzini --- arch/x86/kernel/kvmclock.c | 99 -- 1 file changed, 62 insertions(+), 37 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 08e7726a5e62..ed170171fe49 100644 --- a/arch/x86/kernel

[PATCH v14 15/25] s390/time: add read_persistent_wall_and_boot_offset()

2018-07-17 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 v14 08/25] x86/kvmclock: Avoid TSC recalibration

2018-07-17 Thread Pavel Tatashin
From: Peter Zijlstra If the host gives us a TSC rate, assume it is good and don't try and recalibrate things against virtual timer hardware. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Pavel Tatashin --- arch/x86/kernel/kvmclock.c | 11 ++- 1 file changed, 10 insertions

[PATCH v14 01/25] x86/kvmclock: Remove memblock dependency

2018-07-17 Thread Pavel Tatashin
of the clock - Remove dependency on memblock, and reduce code The downside: - Static allocation of the per cpu data structures sized NR_CPUS * 64byte Will be addressed in follow up patches. [ tglx: Split out from larger series ] Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner

[PATCH v14 25/25] sched: use static key for sched_clock_running

2018-07-17 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 v14 15/25] s390/time: add read_persistent_wall_and_boot_offset()

2018-07-17 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 v14 08/25] x86/kvmclock: Avoid TSC recalibration

2018-07-17 Thread Pavel Tatashin
From: Peter Zijlstra If the host gives us a TSC rate, assume it is good and don't try and recalibrate things against virtual timer hardware. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Pavel Tatashin --- arch/x86/kernel/kvmclock.c | 11 ++- 1 file changed, 10 insertions

[PATCH v14 01/25] x86/kvmclock: Remove memblock dependency

2018-07-17 Thread Pavel Tatashin
of the clock - Remove dependency on memblock, and reduce code The downside: - Static allocation of the per cpu data structures sized NR_CPUS * 64byte Will be addressed in follow up patches. [ tglx: Split out from larger series ] Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner

[PATCH v14 25/25] sched: use static key for sched_clock_running

2018-07-17 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 v14 00/25] Early boot time stamps

2018-07-17 Thread Pavel Tatashin
atch/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 x86/time: read_boot_clock64() impl

[PATCH v14 03/25] x86/kvmclock: Decrapify kvm_register_clock()

2018-07-17 Thread Pavel Tatashin
From: Thomas Gleixner The return value is pointless because the wrmsr cannot fail if KVM_FEATURE_CLOCKSOURCE or KVM_FEATURE_CLOCKSOURCE2 are set. kvm_register_clock() is only called locally so wants to be static. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo

[PATCH v14 02/25] x86/kvmclock: Remove page size requirement from wall_clock

2018-07-17 Thread Pavel Tatashin
From: Thomas Gleixner There is no requirement for wall_clock data to be page aligned or page sized. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini --- arch/x86/kernel/kvmclock.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff

[PATCH v14 00/25] Early boot time stamps

2018-07-17 Thread Pavel Tatashin
atch/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 x86/time: read_boot_clock64() impl

[PATCH v14 03/25] x86/kvmclock: Decrapify kvm_register_clock()

2018-07-17 Thread Pavel Tatashin
From: Thomas Gleixner The return value is pointless because the wrmsr cannot fail if KVM_FEATURE_CLOCKSOURCE or KVM_FEATURE_CLOCKSOURCE2 are set. kvm_register_clock() is only called locally so wants to be static. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo

[PATCH v14 02/25] x86/kvmclock: Remove page size requirement from wall_clock

2018-07-17 Thread Pavel Tatashin
From: Thomas Gleixner There is no requirement for wall_clock data to be page aligned or page sized. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini --- arch/x86/kernel/kvmclock.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff

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

2018-07-17 Thread Pavel Tatashin
> > +static u64 xen_sched_clock(void) > > +{ > > + return xen_clocksource_read() - xen_sched_clock_offset; > > +} > > > Should other invocations of xen_clocksource_read() also be offset? > I do not believe so. Look in arch/x86/kernel/kvmclock.c kvm_clock_get_cycles() is not normalized for

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

2018-07-17 Thread Pavel Tatashin
> > +static u64 xen_sched_clock(void) > > +{ > > + return xen_clocksource_read() - xen_sched_clock_offset; > > +} > > > Should other invocations of xen_clocksource_read() also be offset? > I do not believe so. Look in arch/x86/kernel/kvmclock.c kvm_clock_get_cycles() is not normalized for

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

2018-07-17 Thread Pavel Tatashin
> > + set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_start_info->shared_info); > > + HYPERVISOR_shared_info = (void *)fix_to_virt(FIX_PARAVIRT_BOOTMAP); > > + > > + /* xen clock uses per-cpu vcpu_info, need to init it for boot cpu */ > > + xen_vcpu_info_reset(0); > > > I don't believe this

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

2018-07-17 Thread Pavel Tatashin
> > + set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_start_info->shared_info); > > + HYPERVISOR_shared_info = (void *)fix_to_virt(FIX_PARAVIRT_BOOTMAP); > > + > > + /* xen clock uses per-cpu vcpu_info, need to init it for boot cpu */ > > + xen_vcpu_info_reset(0); > > > I don't believe this

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-17 Thread Pavel Tatashin
> > Oops, yes, my mistake. I will test the patchset with Thomas's kvm patch > for you. Thank you Dou. Please wait for updated series before you test it. I will include patches from Thomas in the updated series. Thank you, Pavel

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-17 Thread Pavel Tatashin
> > Oops, yes, my mistake. I will test the patchset with Thomas's kvm patch > for you. Thank you Dou. Please wait for updated series before you test it. I will include patches from Thomas in the updated series. Thank you, Pavel

[PATCH v6 3/5] mm/sparse: move buffer init/fini to the common place

2018-07-16 Thread Pavel Tatashin
Now, that both variants of sparse memory use the same buffers to populate memory map, we can move sparse_buffer_init()/sparse_buffer_fini() to the common place. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 3 --- mm/sparse-vmemmap.c | 2 -- mm/sparse.c | 14

[PATCH v6 3/5] mm/sparse: move buffer init/fini to the common place

2018-07-16 Thread Pavel Tatashin
Now, that both variants of sparse memory use the same buffers to populate memory map, we can move sparse_buffer_init()/sparse_buffer_fini() to the common place. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 3 --- mm/sparse-vmemmap.c | 2 -- mm/sparse.c | 14

[PATCH v6 2/5] mm/sparse: use the new sparse buffer functions in non-vmemmap

2018-07-16 Thread Pavel Tatashin
non-vmemmap sparse also allocated large contiguous chunk of memory, and if fails falls back to smaller allocations. Use the same functions to allocate buffer as the vmemmap-sparse Signed-off-by: Pavel Tatashin --- mm/sparse.c | 41 ++--- 1 file changed, 14

[PATCH v6 2/5] mm/sparse: use the new sparse buffer functions in non-vmemmap

2018-07-16 Thread Pavel Tatashin
non-vmemmap sparse also allocated large contiguous chunk of memory, and if fails falls back to smaller allocations. Use the same functions to allocate buffer as the vmemmap-sparse Signed-off-by: Pavel Tatashin --- mm/sparse.c | 41 ++--- 1 file changed, 14

[PATCH v6 4/5] mm/sparse: add new sparse_init_nid() and sparse_init()

2018-07-16 Thread Pavel Tatashin
-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- mm/sparse.c | 85 + 1 file changed, 85 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 20ca292d8f11..248d5d7bbf55 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -200,6 +200,11

[PATCH v6 5/5] mm/sparse: delete old sparse_init and enable new one

2018-07-16 Thread Pavel Tatashin
Rename new_sparse_init() to sparse_init() which enables it. Delete old sparse_init() and all the code that became obsolete with. Signed-off-by: Pavel Tatashin Tested-by: Michael Ellerman (powerpc) --- include/linux/mm.h | 6 -- mm/Kconfig | 4 - mm/sparse-vmemmap.c | 21

[PATCH v6 1/5] mm/sparse: abstract sparse buffer allocations

2018-07-16 Thread Pavel Tatashin
-vmemmap.c because later we will use them for non-vmemmap sparse allocations as well. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 4 mm/sparse-vmemmap.c | 40 ++-- mm/sparse.c | 45 - 3 files

[PATCH v6 4/5] mm/sparse: add new sparse_init_nid() and sparse_init()

2018-07-16 Thread Pavel Tatashin
-off-by: Pavel Tatashin Reviewed-by: Oscar Salvador --- mm/sparse.c | 85 + 1 file changed, 85 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 20ca292d8f11..248d5d7bbf55 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -200,6 +200,11

[PATCH v6 5/5] mm/sparse: delete old sparse_init and enable new one

2018-07-16 Thread Pavel Tatashin
Rename new_sparse_init() to sparse_init() which enables it. Delete old sparse_init() and all the code that became obsolete with. Signed-off-by: Pavel Tatashin Tested-by: Michael Ellerman (powerpc) --- include/linux/mm.h | 6 -- mm/Kconfig | 4 - mm/sparse-vmemmap.c | 21

[PATCH v6 1/5] mm/sparse: abstract sparse buffer allocations

2018-07-16 Thread Pavel Tatashin
-vmemmap.c because later we will use them for non-vmemmap sparse allocations as well. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 4 mm/sparse-vmemmap.c | 40 ++-- mm/sparse.c | 45 - 3 files

[PATCH v6 0/5] sparse_init rewrite

2018-07-16 Thread Pavel Tatashin
-1-...@redhat.com The buffers are large enough to cause machine stop to boot on small memory systems. Another benefit of these changes is that they also obsolete CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER. Pavel Tatashin (5): mm/sparse: abstract sparse buffer allocations mm/sparse: use the new

[PATCH v6 0/5] sparse_init rewrite

2018-07-16 Thread Pavel Tatashin
-1-...@redhat.com The buffers are large enough to cause machine stop to boot on small memory systems. Another benefit of these changes is that they also obsolete CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER. Pavel Tatashin (5): mm/sparse: abstract sparse buffer allocations mm/sparse: use the new

Re: [PATCH] mm: don't do zero_resv_unavail if memmap is not allocated

2018-07-16 Thread Pavel Tatashin
On 07/16/2018 12:09 PM, Michal Hocko wrote: > On Mon 16-07-18 11:16:30, Pavel Tatashin wrote: >> Moving zero_resv_unavail before memmap_init_zone(), caused a regression on >> x86-32. >> >> The cause is that we access struct pages before they are allocated when

Re: [PATCH] mm: don't do zero_resv_unavail if memmap is not allocated

2018-07-16 Thread Pavel Tatashin
On 07/16/2018 12:09 PM, Michal Hocko wrote: > On Mon 16-07-18 11:16:30, Pavel Tatashin wrote: >> Moving zero_resv_unavail before memmap_init_zone(), caused a regression on >> x86-32. >> >> The cause is that we access struct pages before they are allocated when

Re: mainline/master boot: 177 boots: 2 failed, 174 passed with 1 conflict (v4.18-rc4-160-gf353078f028f)

2018-07-16 Thread Pavel Tatashin
I have posted a patch for the above issue: http://lkml.kernel.org/r/20180716151630.770-1-pasha.tatas...@oracle.com On Mon, Jul 16, 2018 at 9:15 AM Pavel Tatashin wrote: > > I have figured out what is going with x86-32. Since it has FLATMEM > memory layout, the memmap is now alloca

Re: mainline/master boot: 177 boots: 2 failed, 174 passed with 1 conflict (v4.18-rc4-160-gf353078f028f)

2018-07-16 Thread Pavel Tatashin
I have posted a patch for the above issue: http://lkml.kernel.org/r/20180716151630.770-1-pasha.tatas...@oracle.com On Mon, Jul 16, 2018 at 9:15 AM Pavel Tatashin wrote: > > I have figured out what is going with x86-32. Since it has FLATMEM > memory layout, the memmap is now alloca

[PATCH] mm: don't do zero_resv_unavail if memmap is not allocated

2018-07-16 Thread Pavel Tatashin
navail() here. Fixes: e181ae0c5db9 ("mm: zero unavailable pages before memmap init") Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 2 +- mm/page_alloc.c| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h in

[PATCH] mm: don't do zero_resv_unavail if memmap is not allocated

2018-07-16 Thread Pavel Tatashin
navail() here. Fixes: e181ae0c5db9 ("mm: zero unavailable pages before memmap init") Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 2 +- mm/page_alloc.c| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h in

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-16 Thread Pavel Tatashin
On Mon, Jul 16, 2018 at 5:33 AM Dou Liyang wrote: > > > > At 07/13/2018 07:30 PM, Pavel Tatashin wrote: > > On Fri, Jul 13, 2018 at 3:24 AM Dou Liyang > > wrote: > >> > >> > >> At 07/12/2018 08:04 AM, Pavel Tatashin wro

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-16 Thread Pavel Tatashin
On Mon, Jul 16, 2018 at 5:33 AM Dou Liyang wrote: > > > > At 07/13/2018 07:30 PM, Pavel Tatashin wrote: > > On Fri, Jul 13, 2018 at 3:24 AM Dou Liyang > > wrote: > >> > >> > >> At 07/12/2018 08:04 AM, Pavel Tatashin wro

Re: mainline/master boot: 177 boots: 2 failed, 174 passed with 1 conflict (v4.18-rc4-160-gf353078f028f)

2018-07-16 Thread Pavel Tatashin
(), but that will require more thinking, on how to ensure that no section in memmap is skipped while we go through memmap_init_zone(). Should I submit an updated patch for "mm: zero unavailable pages before memmap init", or just this incremental fix? Thank you, Pavel On Mon, Jul 16, 2018 at 7:56 AM Pave

Re: mainline/master boot: 177 boots: 2 failed, 174 passed with 1 conflict (v4.18-rc4-160-gf353078f028f)

2018-07-16 Thread Pavel Tatashin
(), but that will require more thinking, on how to ensure that no section in memmap is skipped while we go through memmap_init_zone(). Should I submit an updated patch for "mm: zero unavailable pages before memmap init", or just this incremental fix? Thank you, Pavel On Mon, Jul 16, 2018 at 7:56 AM Pave

Re: mainline/master boot: 177 boots: 2 failed, 174 passed with 1 conflict (v4.18-rc4-160-gf353078f028f)

2018-07-16 Thread Pavel Tatashin
2f491a Merge branch 'i2c/for-current' of > > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux > > > Bad:f353078f028f Merge branch 'akpm' (patches from Andrew) > > > Found: e181ae0c5db9 mm: zero unavailable pages before memmap init > > > >

Re: mainline/master boot: 177 boots: 2 failed, 174 passed with 1 conflict (v4.18-rc4-160-gf353078f028f)

2018-07-16 Thread Pavel Tatashin
2f491a Merge branch 'i2c/for-current' of > > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux > > > Bad:f353078f028f Merge branch 'akpm' (patches from Andrew) > > > Found: e181ae0c5db9 mm: zero unavailable pages before memmap init > > > >

Re: [patch 0/7] x86/kvmclock: Remove memblock dependency and further cleanups

2018-07-13 Thread Pavel Tatashin
On 07/13/2018 06:51 PM, Thomas Gleixner wrote: > On Wed, 11 Jul 2018, Pavel Tatashin wrote: > >>> So this still will have some overhead when kvmclock is not in use, but >>> bringing it down to zero would be a massive trainwreck and even more >>> indirecti

Re: [patch 0/7] x86/kvmclock: Remove memblock dependency and further cleanups

2018-07-13 Thread Pavel Tatashin
On 07/13/2018 06:51 PM, Thomas Gleixner wrote: > On Wed, 11 Jul 2018, Pavel Tatashin wrote: > >>> So this still will have some overhead when kvmclock is not in use, but >>> bringing it down to zero would be a massive trainwreck and even more >>> indirecti

Re: [PATCH v5 1/5] mm/sparse: abstract sparse buffer allocations

2018-07-13 Thread Pavel Tatashin
On 07/13/2018 09:17 AM, Oscar Salvador wrote: > On Thu, Jul 12, 2018 at 04:37:26PM -0400, Pavel Tatashin wrote: >> +static void *sparsemap_buf __meminitdata; >> +static void *sparsemap_buf_end __meminitdata; >> + >> +void __init sparse_buffer_init(

Re: [PATCH v5 1/5] mm/sparse: abstract sparse buffer allocations

2018-07-13 Thread Pavel Tatashin
On 07/13/2018 09:17 AM, Oscar Salvador wrote: > On Thu, Jul 12, 2018 at 04:37:26PM -0400, Pavel Tatashin wrote: >> +static void *sparsemap_buf __meminitdata; >> +static void *sparsemap_buf_end __meminitdata; >> + >> +void __init sparse_buffer_init(

Re: [PATCH v5 4/5] mm/sparse: add new sparse_init_nid() and sparse_init()

2018-07-13 Thread Pavel Tatashin
> > Signed-off-by: Pavel Tatashin > > Looks good to me, and it will make the code much shorter/easier. > > Reviewed-by: Oscar Salvador > Thank you! Pave

Re: [PATCH v5 4/5] mm/sparse: add new sparse_init_nid() and sparse_init()

2018-07-13 Thread Pavel Tatashin
> > Signed-off-by: Pavel Tatashin > > Looks good to me, and it will make the code much shorter/easier. > > Reviewed-by: Oscar Salvador > Thank you! Pave

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

2018-07-13 Thread Pavel Tatashin
On Fri, Jul 13, 2018 at 5:13 AM Dou Liyang wrote: > > > > At 07/12/2018 08:04 AM, Pavel Tatashin wrote: > > cyc2ns converts tsc to nanoseconds, and it is handled in a per-cpu data > > structure. > > > > Currently, the setup code for c2ns data for every po

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

2018-07-13 Thread Pavel Tatashin
On Fri, Jul 13, 2018 at 5:13 AM Dou Liyang wrote: > > > > At 07/12/2018 08:04 AM, Pavel Tatashin wrote: > > cyc2ns converts tsc to nanoseconds, and it is handled in a per-cpu data > > structure. > > > > Currently, the setup code for c2ns data for every po

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-13 Thread Pavel Tatashin
On Fri, Jul 13, 2018 at 3:24 AM Dou Liyang wrote: > > > At 07/12/2018 08:04 AM, Pavel Tatashin wrote: > > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > > and the second time in tsc_init(). > > > > Rename tsc_early_delay_calibrate(

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-13 Thread Pavel Tatashin
On Fri, Jul 13, 2018 at 3:24 AM Dou Liyang wrote: > > > At 07/12/2018 08:04 AM, Pavel Tatashin wrote: > > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > > and the second time in tsc_init(). > > > > Rename tsc_early_delay_calibrate(

Re: [PATCH v5 5/5] mm/sparse: delete old sprase_init and enable new one

2018-07-13 Thread Pavel Tatashin
On Fri, Jul 13, 2018 at 5:09 AM Oscar Salvador wrote: > > > > -#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER > > -static void __init sparse_early_mem_maps_alloc_node(void *data, > > - unsigned long pnum_begin, > > - unsigned long

Re: [PATCH v5 5/5] mm/sparse: delete old sprase_init and enable new one

2018-07-13 Thread Pavel Tatashin
On Fri, Jul 13, 2018 at 5:09 AM Oscar Salvador wrote: > > > > -#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER > > -static void __init sparse_early_mem_maps_alloc_node(void *data, > > - unsigned long pnum_begin, > > - unsigned long

Re: [PATCH v5 0/5] sparse_init rewrite

2018-07-13 Thread Pavel Tatashin
> About PPC64, your patchset fixes the issue as the population gets followed by > a > sparse_init_one_section(). > > It can be seen here: > > Before: > > kernel: vmemmap_populate f000..f0004000, node 0 > kernel: * f000..f001 allocated at >

Re: [PATCH v5 0/5] sparse_init rewrite

2018-07-13 Thread Pavel Tatashin
> About PPC64, your patchset fixes the issue as the population gets followed by > a > sparse_init_one_section(). > > It can be seen here: > > Before: > > kernel: vmemmap_populate f000..f0004000, node 0 > kernel: * f000..f001 allocated at >

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

2018-07-12 Thread Pavel Tatashin
> -void __ref xen_init_time_ops(void) > +void __init xen_init_time_ops(void) > { > pv_time_ops = xen_time_ops; > > @@ -542,17 +542,11 @@ void __init xen_hvm_init_time_ops(void) > return; > > if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { > -

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

2018-07-12 Thread Pavel Tatashin
> -void __ref xen_init_time_ops(void) > +void __init xen_init_time_ops(void) > { > pv_time_ops = xen_time_ops; > > @@ -542,17 +542,11 @@ void __init xen_hvm_init_time_ops(void) > return; > > if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { > -

[PATCH v5 2/5] mm/sparse: use the new sparse buffer functions in non-vmemmap

2018-07-12 Thread Pavel Tatashin
non-vmemmap sparse also allocated large contiguous chunk of memory, and if fails falls back to smaller allocations. Use the same functions to allocate buffer as the vmemmap-sparse Signed-off-by: Pavel Tatashin --- mm/sparse.c | 41 ++--- 1 file changed, 14

[PATCH v5 0/5] sparse_init rewrite

2018-07-12 Thread Pavel Tatashin
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER. Pavel Tatashin (5): mm/sparse: abstract sparse buffer allocations mm/sparse: use the new sparse buffer functions in non-vmemmap mm/sparse: move buffer init/fini to the common place mm/sparse: add new sparse_init_nid() and sparse_init() mm/sparse: delete old

[PATCH v5 0/5] sparse_init rewrite

2018-07-12 Thread Pavel Tatashin
CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER. Pavel Tatashin (5): mm/sparse: abstract sparse buffer allocations mm/sparse: use the new sparse buffer functions in non-vmemmap mm/sparse: move buffer init/fini to the common place mm/sparse: add new sparse_init_nid() and sparse_init() mm/sparse: delete old

[PATCH v5 2/5] mm/sparse: use the new sparse buffer functions in non-vmemmap

2018-07-12 Thread Pavel Tatashin
non-vmemmap sparse also allocated large contiguous chunk of memory, and if fails falls back to smaller allocations. Use the same functions to allocate buffer as the vmemmap-sparse Signed-off-by: Pavel Tatashin --- mm/sparse.c | 41 ++--- 1 file changed, 14

[PATCH v5 3/5] mm/sparse: move buffer init/fini to the common place

2018-07-12 Thread Pavel Tatashin
Now, that both variants of sparse memory use the same buffers to populate memory map, we can move sparse_buffer_init()/sparse_buffer_fini() to the common place. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 3 --- mm/sparse-vmemmap.c | 2 -- mm/sparse.c | 14

[PATCH v5 3/5] mm/sparse: move buffer init/fini to the common place

2018-07-12 Thread Pavel Tatashin
Now, that both variants of sparse memory use the same buffers to populate memory map, we can move sparse_buffer_init()/sparse_buffer_fini() to the common place. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 3 --- mm/sparse-vmemmap.c | 2 -- mm/sparse.c | 14

[PATCH v5 5/5] mm/sparse: delete old sprase_init and enable new one

2018-07-12 Thread Pavel Tatashin
Rename new_sparse_init() to sparse_init() which enables it. Delete old sparse_init() and all the code that became obsolete with. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 6 -- mm/Kconfig | 4 - mm/sparse-vmemmap.c | 21 - mm/sparse.c | 217

[PATCH v5 1/5] mm/sparse: abstract sparse buffer allocations

2018-07-12 Thread Pavel Tatashin
-vmemmap.c because later we will use them for non-vmemmap sparse allocations as well. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 4 mm/sparse-vmemmap.c | 40 ++-- mm/sparse.c | 45 - 3 files

[PATCH v5 4/5] mm/sparse: add new sparse_init_nid() and sparse_init()

2018-07-12 Thread Pavel Tatashin
-off-by: Pavel Tatashin --- mm/sparse.c | 85 + 1 file changed, 85 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 01c616342909..4087b94afddf 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -200,6 +200,11 @@ static inline int

[PATCH v5 1/5] mm/sparse: abstract sparse buffer allocations

2018-07-12 Thread Pavel Tatashin
-vmemmap.c because later we will use them for non-vmemmap sparse allocations as well. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 4 mm/sparse-vmemmap.c | 40 ++-- mm/sparse.c | 45 - 3 files

[PATCH v5 4/5] mm/sparse: add new sparse_init_nid() and sparse_init()

2018-07-12 Thread Pavel Tatashin
-off-by: Pavel Tatashin --- mm/sparse.c | 85 + 1 file changed, 85 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index 01c616342909..4087b94afddf 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -200,6 +200,11 @@ static inline int

[PATCH v5 5/5] mm/sparse: delete old sprase_init and enable new one

2018-07-12 Thread Pavel Tatashin
Rename new_sparse_init() to sparse_init() which enables it. Delete old sparse_init() and all the code that became obsolete with. Signed-off-by: Pavel Tatashin --- include/linux/mm.h | 6 -- mm/Kconfig | 4 - mm/sparse-vmemmap.c | 21 - mm/sparse.c | 217

Re: [patch 7/7] x86/kvmclock: Switch kvmclock data to a PER_CPU variable

2018-07-11 Thread Pavel Tatashin
me: Reviewed-by: Pavel Tatashin

Re: [patch 7/7] x86/kvmclock: Switch kvmclock data to a PER_CPU variable

2018-07-11 Thread Pavel Tatashin
me: Reviewed-by: Pavel Tatashin

Re: [patch 6/7] x86/kvmclock: Move kvmclock vsyscall param and init to kvmclock

2018-07-11 Thread Pavel Tatashin
(_clock[0].pvti); > - if (!(flags & PVCLOCK_TSC_STABLE_BIT)) > - return 1; > - > - pvclock_set_pvti_cpu0_va(hv_clock); > - kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK; > -#endif > - return 0; > -} I am not sure what the point of moving this function. The patch would be much smaller without it. Reviewed-by: Pavel Tatashin

Re: [patch 6/7] x86/kvmclock: Move kvmclock vsyscall param and init to kvmclock

2018-07-11 Thread Pavel Tatashin
(_clock[0].pvti); > - if (!(flags & PVCLOCK_TSC_STABLE_BIT)) > - return 1; > - > - pvclock_set_pvti_cpu0_va(hv_clock); > - kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK; > -#endif > - return 0; > -} I am not sure what the point of moving this function. The patch would be much smaller without it. Reviewed-by: Pavel Tatashin

Re: [patch 5/7] x86/kvmclock: Mark variables __initdata and __ro_after_init

2018-07-11 Thread Pavel Tatashin
On Fri, Jul 6, 2018 at 12:25 PM Thomas Gleixner wrote: > > The kvmclock parameter is init data and the other variables are not > modified after init. LGTM: Reviewed-by: Pavel Tatashin

Re: [patch 5/7] x86/kvmclock: Mark variables __initdata and __ro_after_init

2018-07-11 Thread Pavel Tatashin
On Fri, Jul 6, 2018 at 12:25 PM Thomas Gleixner wrote: > > The kvmclock parameter is init data and the other variables are not > modified after init. LGTM: Reviewed-by: Pavel Tatashin

Re: [patch 3/7] x86/kvmclock: Decrapify kvm_register_clock()

2018-07-11 Thread Pavel Tatashin
_time_info *)hv_clock_mem; > + kvm_register_clock("primary cpu clock"); Otherwise, Reviewed-by: Pavel Tatashin

Re: [patch 3/7] x86/kvmclock: Decrapify kvm_register_clock()

2018-07-11 Thread Pavel Tatashin
_time_info *)hv_clock_mem; > + kvm_register_clock("primary cpu clock"); Otherwise, Reviewed-by: Pavel Tatashin

Re: [patch 2/7] x86/kvmclock: Remove page size requirement from wall_clock

2018-07-11 Thread Pavel Tatashin
On Fri, Jul 6, 2018 at 12:26 PM Thomas Gleixner wrote: > > There is no requirement for wall_clock data to be page aligned or page > sized. > Reviewed-by: Pavel Tatashin

Re: [patch 2/7] x86/kvmclock: Remove page size requirement from wall_clock

2018-07-11 Thread Pavel Tatashin
On Fri, Jul 6, 2018 at 12:26 PM Thomas Gleixner wrote: > > There is no requirement for wall_clock data to be page aligned or page > sized. > Reviewed-by: Pavel Tatashin

Re: [patch 0/7] x86/kvmclock: Remove memblock dependency and further cleanups

2018-07-11 Thread Pavel Tatashin
> So this still will have some overhead when kvmclock is not in use, but > bringing it down to zero would be a massive trainwreck and even more > indirections. Hi Thomas, In my opinion, having kvmclock page in __initdata for boot cpu, and setup it in init_hypervisor_platform(). Later, switch to

Re: [patch 0/7] x86/kvmclock: Remove memblock dependency and further cleanups

2018-07-11 Thread Pavel Tatashin
> So this still will have some overhead when kvmclock is not in use, but > bringing it down to zero would be a massive trainwreck and even more > indirections. Hi Thomas, In my opinion, having kvmclock page in __initdata for boot cpu, and setup it in init_hypervisor_platform(). Later, switch to

[PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-11 Thread Pavel Tatashin
(). Sometimes it is not possible to determine tsc early, as the subsystem that is required is not yet initialized, in such case try again later in tsc_init(). Suggested-by: Thomas Gleixner Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/tsc.h | 2 +- arch/x86/kernel/setup.c| 2 +- arch

[PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-11 Thread Pavel Tatashin
(). Sometimes it is not possible to determine tsc early, as the subsystem that is required is not yet initialized, in such case try again later in tsc_init(). Suggested-by: Thomas Gleixner Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/tsc.h | 2 +- arch/x86/kernel/setup.c| 2 +- arch

[PATCH v13 01/18] x86: text_poke() may access uninitialized struct pages

2018-07-11 Thread Pavel Tatashin
ialized during handover from memblock. Use text_poke_early() in static branching until early boot IRQs are enabled, at which time switch to text_poke. Also, ensure text_poke() is never invoked when unitialized memory access may happen by using: BUG_ON(!after_bootmem); assertion. Signed-off-by:

[PATCH v13 16/18] sched: move sched clock initialization and merge with generic clock

2018-07-11 Thread Pavel Tatashin
time_init(). Suggested-by: Peter Zijlstra Signed-off-by: Pavel Tatashin --- include/linux/sched_clock.h | 5 ++--- init/main.c | 4 ++-- kernel/sched/clock.c| 26 -- kernel/sched/core.c | 1 - kernel/time/sched_clock.c | 2 +- 5 files

[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 01/18] x86: text_poke() may access uninitialized struct pages

2018-07-11 Thread Pavel Tatashin
ialized during handover from memblock. Use text_poke_early() in static branching until early boot IRQs are enabled, at which time switch to text_poke. Also, ensure text_poke() is never invoked when unitialized memory access may happen by using: BUG_ON(!after_bootmem); assertion. Signed-off-by:

[PATCH v13 16/18] sched: move sched clock initialization and merge with generic clock

2018-07-11 Thread Pavel Tatashin
time_init(). Suggested-by: Peter Zijlstra Signed-off-by: Pavel Tatashin --- include/linux/sched_clock.h | 5 ++--- init/main.c | 4 ++-- kernel/sched/clock.c| 26 -- kernel/sched/core.c | 1 - kernel/time/sched_clock.c | 2 +- 5 files

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