[PATCH v12 11/11] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
() is in a hot path, we want to make sure that no regressions are introduced to this function, with the current approach sched_clock() path is not modified at all. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 40 ++-- 1 file changed, 26 insertions(+), 14

[PATCH v12 05/11] s390/time: add read_persistent_wall_and_boot_offset()

2018-06-21 Thread Pavel Tatashin
of read_persistent_clock64() Signed-off-by: Pavel Tatashin --- 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/arch/s390/kernel/time.c @@ -221,6

[PATCH v12 10/11] sched: early boot clock

2018-06-21 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() and sched_clock_init_late() are called. This provides us with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH v12 05/11] s390/time: add read_persistent_wall_and_boot_offset()

2018-06-21 Thread Pavel Tatashin
of read_persistent_clock64() Signed-off-by: Pavel Tatashin --- 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/arch/s390/kernel/time.c @@ -221,6

[PATCH v12 10/11] sched: early boot clock

2018-06-21 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() and sched_clock_init_late() are called. This provides us with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 10 -- 1 file changed, 8 insertions(+), 2

Re: [PATCH v11 3/6] time: replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

2018-06-21 Thread Pavel Tatashin
> Please don't make that a wholesale patch. I surely indicated the steps > which are required and the steps can be done as separate patches easily, Hi Thomas, I will split it into several patches in the next version. Thank you, Pavel

Re: [PATCH v11 3/6] time: replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

2018-06-21 Thread Pavel Tatashin
> Please don't make that a wholesale patch. I surely indicated the steps > which are required and the steps can be done as separate patches easily, Hi Thomas, I will split it into several patches in the next version. Thank you, Pavel

Re: [PATCH v11 6/6] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
> Bah, no, we don't make a mess first and then maybe clean it up. OK, I will add this path to the series. > > Have a look at the below. The patch is a mess, but I have two sick kids > on hands Sorry to hear that, I hope your kids will get better soon. > , please clean up / split where

Re: [PATCH v11 6/6] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
> Bah, no, we don't make a mess first and then maybe clean it up. OK, I will add this path to the series. > > Have a look at the below. The patch is a mess, but I have two sick kids > on hands Sorry to hear that, I hope your kids will get better soon. > , please clean up / split where

Re: [PATCH v11 6/6] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
> Do we still need add a static_key? after Peter worked out the patch > to enable ealy jump_label_init? Hi Feng, With Pete's patch we will still need at least one static branch, but as I replied to Pete's email I like the idea of initializing jump_label_init() early, but in my opinion it should

Re: [PATCH v11 6/6] x86/tsc: use tsc early

2018-06-21 Thread Pavel Tatashin
> Do we still need add a static_key? after Peter worked out the patch > to enable ealy jump_label_init? Hi Feng, With Pete's patch we will still need at least one static branch, but as I replied to Pete's email I like the idea of initializing jump_label_init() early, but in my opinion it should

Re: [PATCH 4/4] mm/memory_hotplug: Drop unnecessary checks from register_mem_sect_under_node

2018-06-20 Thread Pavel Tatashin
ed in case > the node is online, so we can safely remove that check as well. > > Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin > --- > drivers/base/node.c | 5 - > 1 file changed, 5 deletions(-) > > diff --git a/drivers/base/node.c b/drivers/base/nod

Re: [PATCH 4/4] mm/memory_hotplug: Drop unnecessary checks from register_mem_sect_under_node

2018-06-20 Thread Pavel Tatashin
ed in case > the node is online, so we can safely remove that check as well. > > Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin > --- > drivers/base/node.c | 5 - > 1 file changed, 5 deletions(-) > > diff --git a/drivers/base/node.c b/drivers/base/nod

Re: [PATCH 3/4] mm/memory_hotplug: Get rid of link_mem_sections

2018-06-20 Thread Pavel Tatashin
On Fri, Jun 1, 2018 at 8:54 AM wrote: > > From: Oscar Salvador > > link_mem_sections() and walk_memory_range() share most of the code, > so we can use walk_memory_range() with a callback to > register_mem_sect_under_node() > instead of using link_mem_sections(). Yes, their logic is indeed

Re: [PATCH 3/4] mm/memory_hotplug: Get rid of link_mem_sections

2018-06-20 Thread Pavel Tatashin
On Fri, Jun 1, 2018 at 8:54 AM wrote: > > From: Oscar Salvador > > link_mem_sections() and walk_memory_range() share most of the code, > so we can use walk_memory_range() with a callback to > register_mem_sect_under_node() > instead of using link_mem_sections(). Yes, their logic is indeed

Re: [PATCH 2/4] mm/memory_hotplug: Call register_mem_sect_under_node

2018-06-20 Thread Pavel Tatashin
e node here. we can't roll back from here. */ And replace all: > + if (ret) > + goto register_fail; With: BUG_ON(ret); With the above addressed: Reviewed-by: Pavel Tatashin

Re: [PATCH 2/4] mm/memory_hotplug: Call register_mem_sect_under_node

2018-06-20 Thread Pavel Tatashin
e node here. we can't roll back from here. */ And replace all: > + if (ret) > + goto register_fail; With: BUG_ON(ret); With the above addressed: Reviewed-by: Pavel Tatashin

Re: [PATCH 1/4] mm/memory_hotplug: Make add_memory_resource use __try_online_node

2018-06-20 Thread Pavel Tatashin
rror; To: ret = __try_online_node (nid, start, false); if (ret < 0) goto error; new_node = ret; Other than that the patch looks good to me, it simplifies the code. So, if the above is addressed: Reviewed-by: Pavel Tatashin Thank you, Pavel > >

Re: [PATCH 1/4] mm/memory_hotplug: Make add_memory_resource use __try_online_node

2018-06-20 Thread Pavel Tatashin
rror; To: ret = __try_online_node (nid, start, false); if (ret < 0) goto error; new_node = ret; Other than that the patch looks good to me, it simplifies the code. So, if the above is addressed: Reviewed-by: Pavel Tatashin Thank you, Pavel > >

[PATCH v11 5/6] sched: early boot clock

2018-06-20 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() and sched_clock_init_late() are called. This provides us with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH v11 5/6] sched: early boot clock

2018-06-20 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() and sched_clock_init_late() are called. This provides us with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 10 -- 1 file changed, 8 insertions(+), 2

Re: [PATCH v10 7/7] x86/tsc: use tsc early

2018-06-20 Thread Pavel Tatashin
Hi Peter, > That said; flipping static keys early isn't hard. We should call > jump_label_init() early, because we want the entries sorted and the > key->entries link set. It will also replace the GENERIC_NOP5_ATOMIC > thing, which means we need to also do arch_init_ideal_nop() early, but > since

Re: [PATCH v10 7/7] x86/tsc: use tsc early

2018-06-20 Thread Pavel Tatashin
Hi Peter, > That said; flipping static keys early isn't hard. We should call > jump_label_init() early, because we want the entries sorted and the > key->entries link set. It will also replace the GENERIC_NOP5_ATOMIC > thing, which means we need to also do arch_init_ideal_nop() early, but > since

[PATCH v11 6/6] x86/tsc: use tsc early

2018-06-20 Thread Pavel Tatashin
() is in a hot path, we want to make sure that no regressions are introduced to this function after machine is booted, this is why we are using static branch that is enabled by default, but is disabled once we have initialized a permanent clock source. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c

[PATCH v11 6/6] x86/tsc: use tsc early

2018-06-20 Thread Pavel Tatashin
() is in a hot path, we want to make sure that no regressions are introduced to this function after machine is booted, this is why we are using static branch that is enabled by default, but is disabled once we have initialized a permanent clock source. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c

[PATCH v11 2/6] kvm/x86: remove kvm memblock dependency

2018-06-20 Thread Pavel Tatashin
availability of TSC. - remove dependency on memblock, and reduce code - earlier kvm sched_clock() Signed-off-by: Pavel Tatashin --- arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/kvmclock.c | 64 ++ arch/x86/kernel/setup.c| 7 ++--- 3 files changed, 12

[PATCH v11 3/6] time: replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

2018-06-20 Thread Pavel Tatashin
a better and more consistent estimate of the boot time without need for an arch specific implementation. Signed-off-by: Pavel Tatashin --- arch/arm/kernel/time.c | 12 +--- arch/s390/kernel/time.c | 11 +-- include/linux/timekeeping.h | 3 +- kernel/time/timekeeping.c | 61

[PATCH v11 2/6] kvm/x86: remove kvm memblock dependency

2018-06-20 Thread Pavel Tatashin
availability of TSC. - remove dependency on memblock, and reduce code - earlier kvm sched_clock() Signed-off-by: Pavel Tatashin --- arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/kvmclock.c | 64 ++ arch/x86/kernel/setup.c| 7 ++--- 3 files changed, 12

[PATCH v11 3/6] time: replace read_boot_clock64() with read_persistent_wall_and_boot_offset()

2018-06-20 Thread Pavel Tatashin
a better and more consistent estimate of the boot time without need for an arch specific implementation. Signed-off-by: Pavel Tatashin --- arch/arm/kernel/time.c | 12 +--- arch/s390/kernel/time.c | 11 +-- include/linux/timekeeping.h | 3 +- kernel/time/timekeeping.c | 61

[PATCH v11 0/6] Early boot time stamps for x86

2018-06-20 Thread Pavel Tatashin
deferred page initialization. Example 2: 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_

[PATCH v11 0/6] Early boot time stamps for x86

2018-06-20 Thread Pavel Tatashin
deferred page initialization. Example 2: 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_

[PATCH v11 1/6] x86/tsc: redefine notsc to behave as tsc=unstable

2018-06-20 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 --- .../admin-guide/kernel-parameters.txt

[PATCH v11 1/6] x86/tsc: redefine notsc to behave as tsc=unstable

2018-06-20 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 --- .../admin-guide/kernel-parameters.txt

[PATCH v11 4/6] x86/tsc: prepare for early sched_clock

2018-06-20 Thread Pavel Tatashin
uced: [0.002233] Calibrating delay loop (skipped), value calculated using timer frequency.. 6384.27 BogoMIPS (lpj=3192137) [0.002516] pid_max: default: 32768 minimum: 301 Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 15 +-- 1 file changed, 9 insertions(+), 6 delet

[PATCH v11 4/6] x86/tsc: prepare for early sched_clock

2018-06-20 Thread Pavel Tatashin
uced: [0.002233] Calibrating delay loop (skipped), value calculated using timer frequency.. 6384.27 BogoMIPS (lpj=3192137) [0.002516] pid_max: default: 32768 minimum: 301 Signed-off-by: Pavel Tatashin --- arch/x86/kernel/tsc.c | 15 +-- 1 file changed, 9 insertions(+), 6 delet

Re: [PATCH v10 7/7] x86/tsc: use tsc early

2018-06-19 Thread Pavel Tatashin
On 06/19/2018 07:52 PM, Thomas Gleixner wrote: > On Fri, 15 Jun 2018, Pavel Tatashin wrote: > >> tsc_early_init(): >> Determines offset, shift and multiplier for the early clock based on the >> TSC frequency. >> >> tsc_early_fini() >> Implement th

Re: [PATCH v10 7/7] x86/tsc: use tsc early

2018-06-19 Thread Pavel Tatashin
On 06/19/2018 07:52 PM, Thomas Gleixner wrote: > On Fri, 15 Jun 2018, Pavel Tatashin wrote: > >> tsc_early_init(): >> Determines offset, shift and multiplier for the early clock based on the >> TSC frequency. >> >> tsc_early_fini() >> Implement th

Re: [PATCH v10 2/7] time: sync read_boot_clock64() with persistent clock

2018-06-19 Thread Pavel Tatashin
On Tue, Jun 19, 2018 at 5:17 PM Thomas Gleixner wrote: > > On Fri, 15 Jun 2018, Pavel Tatashin wrote: > > > read_boot_clock64() returns a boot start timestamp from epoch. Some arches > > may need to access the persistent clock interface in order to calculate the > > e

Re: [PATCH v10 2/7] time: sync read_boot_clock64() with persistent clock

2018-06-19 Thread Pavel Tatashin
On Tue, Jun 19, 2018 at 5:17 PM Thomas Gleixner wrote: > > On Fri, 15 Jun 2018, Pavel Tatashin wrote: > > > read_boot_clock64() returns a boot start timestamp from epoch. Some arches > > may need to access the persistent clock interface in order to calculate the > > e

Re: [PATCH v10 1/7] x86/tsc: remove tsc_disabled flag

2018-06-19 Thread Pavel Tatashin
> > tsc_disabled is set when notsc is passed as kernel parameter. The reason we > > have notsc is to avoid timing problems on multi-socket systems. We already > > have a mechanism, however, to detect and resolve these issues by invoking > > tsc unstable path. Thus, make notsc to behave the same

Re: [PATCH v10 1/7] x86/tsc: remove tsc_disabled flag

2018-06-19 Thread Pavel Tatashin
> > tsc_disabled is set when notsc is passed as kernel parameter. The reason we > > have notsc is to avoid timing problems on multi-socket systems. We already > > have a mechanism, however, to detect and resolve these issues by invoking > > tsc unstable path. Thus, make notsc to behave the same

Re: [PATCH v10 3/7] x86/time: read_boot_clock64() implementation

2018-06-19 Thread Pavel Tatashin
> > > +void __init read_boot_clock64(struct timespec64 *now, struct timespec64 > > > *ts) > > > +{ > > > + u64 ns_boot = sched_clock_cpu(smp_processor_id()); > > > + bool valid_clock; > > > + u64 ns_now; > > > + > > > + ns_now = timespec64_to_ns(now); > > > +

Re: [PATCH v10 3/7] x86/time: read_boot_clock64() implementation

2018-06-19 Thread Pavel Tatashin
> > > +void __init read_boot_clock64(struct timespec64 *now, struct timespec64 > > > *ts) > > > +{ > > > + u64 ns_boot = sched_clock_cpu(smp_processor_id()); > > > + bool valid_clock; > > > + u64 ns_now; > > > + > > > + ns_now = timespec64_to_ns(now); > > > +

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

2018-06-18 Thread Pavel Tatashin
> So I expect this patch needs a cc:stable, which I'll add. Yes. > The optimiation patch seems less important and I'd like to hold that > off for 4.19-rc1? I agree, the optimization is not as important, and can wait for 4.19.

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

2018-06-18 Thread Pavel Tatashin
> So I expect this patch needs a cc:stable, which I'll add. Yes. > The optimiation patch seems less important and I'd like to hold that > off for 4.19-rc1? I agree, the optimization is not as important, and can wait for 4.19.

Re: [PATCH] mm: skip invalid pages block at a time in zero_resv_unresv

2018-06-15 Thread Pavel Tatashin
On Fri, Jun 15, 2018 at 5:48 PM Andrew Morton wrote: > > On Fri, 15 Jun 2018 11:57:33 -0400 Pavel Tatashin > wrote: > > > The role of zero_resv_unavail() is to make sure that every struct page that > > is allocated but is not backed by memory that is accessible

Re: [PATCH] mm: skip invalid pages block at a time in zero_resv_unresv

2018-06-15 Thread Pavel Tatashin
On Fri, Jun 15, 2018 at 5:48 PM Andrew Morton wrote: > > On Fri, 15 Jun 2018 11:57:33 -0400 Pavel Tatashin > wrote: > > > The role of zero_resv_unavail() is to make sure that every struct page that > > is allocated but is not backed by memory that is accessible

Re: [PATCH] mm: skip invalid pages block at a time in zero_resv_unresv

2018-06-15 Thread Pavel Tatashin
> Hi Pavel, > > Thanks for the patch. > This looks good to me. > > Reviewed-by: Oscar Salvador Thank you Oscar! Pavel

Re: [PATCH] mm: skip invalid pages block at a time in zero_resv_unresv

2018-06-15 Thread Pavel Tatashin
> Hi Pavel, > > Thanks for the patch. > This looks good to me. > > Reviewed-by: Oscar Salvador Thank you Oscar! Pavel

[PATCH v10 3/7] x86/time: read_boot_clock64() implementation

2018-06-15 Thread Pavel Tatashin
read_boot_clock64() returns time of when system was started. Now, that early boot clock is going to be available on x86 it is possible to implement x86 specific version of read_boot_clock64() that takes advantage of this new feature. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/time.c | 30

[PATCH v10 3/7] x86/time: read_boot_clock64() implementation

2018-06-15 Thread Pavel Tatashin
read_boot_clock64() returns time of when system was started. Now, that early boot clock is going to be available on x86 it is possible to implement x86 specific version of read_boot_clock64() that takes advantage of this new feature. Signed-off-by: Pavel Tatashin --- arch/x86/kernel/time.c | 30

[PATCH v10 6/7] x86/paravirt: add active_sched_clock to pv_time_ops

2018-06-15 Thread Pavel Tatashin
. Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/paravirt_types.h | 1 + arch/x86/kernel/paravirt.c| 1 + arch/x86/xen/time.c | 7 --- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include

[PATCH v10 6/7] x86/paravirt: add active_sched_clock to pv_time_ops

2018-06-15 Thread Pavel Tatashin
. Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/paravirt_types.h | 1 + arch/x86/kernel/paravirt.c| 1 + arch/x86/xen/time.c | 7 --- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include

[PATCH v10 1/7] x86/tsc: remove tsc_disabled flag

2018-06-15 Thread Pavel Tatashin
. Signed-off-by: Pavel Tatashin Reviewed-by: Dou Liyang --- arch/x86/kernel/tsc.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 74392d9d51e0..186395041725 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86

[PATCH v10 1/7] x86/tsc: remove tsc_disabled flag

2018-06-15 Thread Pavel Tatashin
. Signed-off-by: Pavel Tatashin Reviewed-by: Dou Liyang --- arch/x86/kernel/tsc.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 74392d9d51e0..186395041725 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86

[PATCH v10 7/7] x86/tsc: use tsc early

2018-06-15 Thread Pavel Tatashin
and switch back to the default clock. The supported x86 systems are those where TSC frequency is determined early in boot. Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/paravirt.h | 2 +- arch/x86/kernel/tsc.c | 98 - 2 files changed, 97

[PATCH v10 0/7] Early boot time stamps for x86

2018-06-15 Thread Pavel Tatashin
g 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() implementation sched: early boot clock kvm/x86: remove kvm memblock dependency

[PATCH v10 2/7] time: sync read_boot_clock64() with persistent clock

2018-06-15 Thread Pavel Tatashin
' is added to read_boot_clock64() parameters. Arch may decide to use it instead of accessing persistent clock again. Also, change read_boot_clock64() to have __init prototype since it is accessed only during boot. Signed-off-by: Pavel Tatashin --- arch/arm/kernel/time.c | 2 +- arch/s390

[PATCH v10 7/7] x86/tsc: use tsc early

2018-06-15 Thread Pavel Tatashin
and switch back to the default clock. The supported x86 systems are those where TSC frequency is determined early in boot. Signed-off-by: Pavel Tatashin --- arch/x86/include/asm/paravirt.h | 2 +- arch/x86/kernel/tsc.c | 98 - 2 files changed, 97

[PATCH v10 0/7] Early boot time stamps for x86

2018-06-15 Thread Pavel Tatashin
g 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() implementation sched: early boot clock kvm/x86: remove kvm memblock dependency

[PATCH v10 2/7] time: sync read_boot_clock64() with persistent clock

2018-06-15 Thread Pavel Tatashin
' is added to read_boot_clock64() parameters. Arch may decide to use it instead of accessing persistent clock again. Also, change read_boot_clock64() to have __init prototype since it is accessed only during boot. Signed-off-by: Pavel Tatashin --- arch/arm/kernel/time.c | 2 +- arch/s390

[PATCH v10 4/7] sched: early boot clock

2018-06-15 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() and sched_clock_init_late() are called. This provides us with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH v10 4/7] sched: early boot clock

2018-06-15 Thread Pavel Tatashin
Allow sched_clock() to be used before schec_clock_init() and sched_clock_init_late() are called. This provides us with a way to get early boot timestamps on machines with unstable clocks. Signed-off-by: Pavel Tatashin --- kernel/sched/clock.c | 10 -- 1 file changed, 8 insertions(+), 2

[PATCH v10 5/7] kvm/x86: remove kvm memblock dependency

2018-06-15 Thread Pavel Tatashin
on memblock, and reduce code Signed-off-by: Pavel Tatashin --- arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/kvmclock.c | 64 ++ arch/x86/kernel/setup.c| 7 ++--- 3 files changed, 12 insertions(+), 60 deletions(-) diff --git a/arch/x86/kernel/kvm.c b

[PATCH v10 5/7] kvm/x86: remove kvm memblock dependency

2018-06-15 Thread Pavel Tatashin
on memblock, and reduce code Signed-off-by: Pavel Tatashin --- arch/x86/kernel/kvm.c | 1 + arch/x86/kernel/kvmclock.c | 64 ++ arch/x86/kernel/setup.c| 7 ++--- 3 files changed, 12 insertions(+), 60 deletions(-) diff --git a/arch/x86/kernel/kvm.c b

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

2018-06-15 Thread Pavel Tatashin
> Hi Pavel, > > I think this makes a lot of sense. > Since Naoya is out until Wednesday, maybe I give it a shot next week and see > if I can gather some numbers. Hi Oscar, Thank you for the offer to do this. Since, sched_clock() is not yet initialized at the time zero_resv_unavail() is called,

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

2018-06-15 Thread Pavel Tatashin
> Hi Pavel, > > I think this makes a lot of sense. > Since Naoya is out until Wednesday, maybe I give it a shot next week and see > if I can gather some numbers. Hi Oscar, Thank you for the offer to do this. Since, sched_clock() is not yet initialized at the time zero_resv_unavail() is called,

[PATCH] mm: skip invalid pages block at a time in zero_resv_unresv

2018-06-15 Thread Pavel Tatashin
to measure the performance improvement. With 1T hole on i7-8700 currently we would take 0.606918s of boot time, but with this optimization 0.001103s. Signed-off-by: Pavel Tatashin --- mm/page_alloc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm

[PATCH] mm: skip invalid pages block at a time in zero_resv_unresv

2018-06-15 Thread Pavel Tatashin
to measure the performance improvement. With 1T hole on i7-8700 currently we would take 0.606918s of boot time, but with this optimization 0.001103s. Signed-off-by: Pavel Tatashin --- mm/page_alloc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm

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

2018-06-15 Thread Pavel Tatashin
g struct pages will be skipped. But, I am worried on the performance implications of when the holes of invalid memory are rather large. We would have to loop through it in zero_resv_unavail() one pfn at a time. Therefore, we might also need to optimize zero_resv_unavail() a little like this: 6407

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

2018-06-15 Thread Pavel Tatashin
g struct pages will be skipped. But, I am worried on the performance implications of when the holes of invalid memory are rather large. We would have to loop through it in zero_resv_unavail() one pfn at a time. Therefore, we might also need to optimize zero_resv_unavail() a little like this: 6407

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Pavel Tatashin
Hi Feng, Using a global variable for this is not going to work, because you are adding a conditional branch and a load to a very hot path for the live of the system, not only for the duration of the boot. Pavel > > +int tsc_inited; > /* > * TSC can be unstable due to cpufreq or due to

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-06 Thread Pavel Tatashin
Hi Feng, Using a global variable for this is not going to work, because you are adding a conditional branch and a load to a very hot path for the live of the system, not only for the duration of the boot. Pavel > > +int tsc_inited; > /* > * TSC can be unstable due to cpufreq or due to

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-01 Thread Pavel Tatashin
2018 at 11:52 AM Peter Zijlstra wrote: > > On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek wrote: > > I wonder if we could get some cleaner integration into the timer and > > printk code. > > Yes, these patches are particularly horrific.. > > There were some earlie

Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp

2018-06-01 Thread Pavel Tatashin
2018 at 11:52 AM Peter Zijlstra wrote: > > On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek wrote: > > I wonder if we could get some cleaner integration into the timer and > > printk code. > > Yes, these patches are particularly horrific.. > > There were some earlie

Re: [PATCH 2/2] mm: do not warn on offline nodes unless the specific node is explicitly requested

2018-05-23 Thread Pavel Tatashin
Reviewed-by: Pavel Tatashin <pasha.tatas...@oracle.com>

Re: [PATCH 2/2] mm: do not warn on offline nodes unless the specific node is explicitly requested

2018-05-23 Thread Pavel Tatashin
Reviewed-by: Pavel Tatashin

Re: [PATCH 1/2] mm, memory_hotplug: make has_unmovable_pages more robust

2018-05-23 Thread Pavel Tatashin
Reviewed-by: Pavel Tatashin <pasha.tatas...@oracle.com>

Re: [PATCH 1/2] mm, memory_hotplug: make has_unmovable_pages more robust

2018-05-23 Thread Pavel Tatashin
Reviewed-by: Pavel Tatashin

Re: [PATCH v2 1/1] drivers core: multi-threading device shutdown

2018-05-23 Thread Pavel Tatashin
Hi Pavel, Thank you for looking at this patch. BTW, the version 5 is out. The latest thread is anchered here: http://lkml.kernel.org/r/20180516024004.28977-1-pasha.tatas...@oracle.com > ixgbe is network card, right? So ... it does not have any persistent > state and no moving parts, and there's

Re: [PATCH v2 1/1] drivers core: multi-threading device shutdown

2018-05-23 Thread Pavel Tatashin
Hi Pavel, Thank you for looking at this patch. BTW, the version 5 is out. The latest thread is anchered here: http://lkml.kernel.org/r/20180516024004.28977-1-pasha.tatas...@oracle.com > ixgbe is network card, right? So ... it does not have any persistent > state and no moving parts, and there's

[PATCH v5 0/3] multi-threading device shutdown

2018-05-15 Thread Pavel Tatashin
e time device_shutdown() is called, there is no reason not to utilize all the available CPU resources. Pavel Tatashin (3): drivers core: refactor device_shutdown drivers core: prepare device_shutdown for multi-threading drivers core: multi-threading device shutdown drivers/base/core.c

[PATCH v5 0/3] multi-threading device shutdown

2018-05-15 Thread Pavel Tatashin
e time device_shutdown() is called, there is no reason not to utilize all the available CPU resources. Pavel Tatashin (3): drivers core: refactor device_shutdown drivers core: prepare device_shutdown for multi-threading drivers core: multi-threading device shutdown drivers/base/core.c

[PATCH v5 3/3] drivers core: multi-threading device shutdown

2018-05-15 Thread Pavel Tatashin
4 one second delay only 0.38s This feature can be optionally disabled via kernel parameter: device_shutdown_serial. When booted with this parameter, device_shutdown() will shutdown devices one by one. Signed-off-by: Pavel Tatashin <pasha.tatas...@oracle.com> --- driver

[PATCH v5 1/3] drivers core: refactor device_shutdown

2018-05-15 Thread Pavel Tatashin
ration on one device. Signed-off-by: Pavel Tatashin <pasha.tatas...@oracle.com> --- drivers/base/core.c | 50 +++-- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index b610816eb887..ed189f6

[PATCH v5 3/3] drivers core: multi-threading device shutdown

2018-05-15 Thread Pavel Tatashin
4 one second delay only 0.38s This feature can be optionally disabled via kernel parameter: device_shutdown_serial. When booted with this parameter, device_shutdown() will shutdown devices one by one. Signed-off-by: Pavel Tatashin --- drivers/base/core.c | 70

[PATCH v5 1/3] drivers core: refactor device_shutdown

2018-05-15 Thread Pavel Tatashin
ration on one device. Signed-off-by: Pavel Tatashin --- drivers/base/core.c | 50 +++-- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index b610816eb887..ed189f6d1a2f 100644 --- a/drivers/base/core.c

[PATCH v5 2/3] drivers core: prepare device_shutdown for multi-threading

2018-05-15 Thread Pavel Tatashin
be multi-threaded have _task() in their name. Signed-off-by: Pavel Tatashin <pasha.tatas...@oracle.com> --- drivers/base/core.c | 178 1 file changed, 149 insertions(+), 29 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c

[PATCH v5 2/3] drivers core: prepare device_shutdown for multi-threading

2018-05-15 Thread Pavel Tatashin
be multi-threaded have _task() in their name. Signed-off-by: Pavel Tatashin --- drivers/base/core.c | 178 1 file changed, 149 insertions(+), 29 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index ed189f6d1a2f..210b619931bc 100644

Re: [PATCH v5] mm: don't allow deferred pages with NEED_PER_CPU_KM

2018-05-15 Thread Pavel Tatashin
> > My recent fix exposed this problem, > "my recent fix" isn't very useful. I changed this to identify > c9e97a1997 ("mm: initialize pages on demand during boot"), yes? Yes, thank you. Pavel

Re: [PATCH v5] mm: don't allow deferred pages with NEED_PER_CPU_KM

2018-05-15 Thread Pavel Tatashin
> > My recent fix exposed this problem, > "my recent fix" isn't very useful. I changed this to identify > c9e97a1997 ("mm: initialize pages on demand during boot"), yes? Yes, thank you. Pavel

[PATCH v5] mm: don't allow deferred pages with NEED_PER_CPU_KM

2018-05-15 Thread Pavel Tatashin
CONFIG_DEFERRED_STRUCT_PAGE_INIT is set") Signed-off-by: Pavel Tatashin <pasha.tatas...@oracle.com> --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig b/mm/Kconfig index d5004d82a1d6..e14c01513bfd 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -636,6 +636,7 @@

[PATCH v5] mm: don't allow deferred pages with NEED_PER_CPU_KM

2018-05-15 Thread Pavel Tatashin
CONFIG_DEFERRED_STRUCT_PAGE_INIT is set") Signed-off-by: Pavel Tatashin --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig b/mm/Kconfig index d5004d82a1d6..e14c01513bfd 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -636,6 +636,7 @@ config DEFERRED_STRUCT_PAGE_INIT

Re: [PATCH v2] mm: allow deferred page init for vmemmap only

2018-05-15 Thread Pavel Tatashin
> This will always be a maze as the early boot tends to be. Sad but true. > That is why I am not really convinced we should use a large hammer and > disallow deferred page initialization just because UP implementation of > pcp does something too early. We should instead rule that one odd case. >

Re: [PATCH v2] mm: allow deferred page init for vmemmap only

2018-05-15 Thread Pavel Tatashin
> This will always be a maze as the early boot tends to be. Sad but true. > That is why I am not really convinced we should use a large hammer and > disallow deferred page initialization just because UP implementation of > pcp does something too early. We should instead rule that one odd case. >

Re: [PATCH v4 1/1] drivers core: multi-threading device shutdown

2018-05-15 Thread Pavel Tatashin
Hi Greg, > Can you refactor this to be at least 2 patches? One that moves code > around to comon functions to make the second patch, that adds the new > functionality, easier to review and understand? Yes, I will split the patch into a two-three patches. > And I echo the "don't use kerneldoc

Re: [PATCH v4 1/1] drivers core: multi-threading device shutdown

2018-05-15 Thread Pavel Tatashin
Hi Greg, > Can you refactor this to be at least 2 patches? One that moves code > around to comon functions to make the second patch, that adds the new > functionality, easier to review and understand? Yes, I will split the patch into a two-three patches. > And I echo the "don't use kerneldoc

Re: [PATCH v2] mm: allow deferred page init for vmemmap only

2018-05-15 Thread Pavel Tatashin
Hi Michal, Thank you for your reply, my comments below: > You are now disabling a potentially useful feature to SPARSEMEM users > without having any evidence that they do suffer from the issue which is > kinda sad. Especially when the only known offender is a UP pcp allocator > implementation.

Re: [PATCH v2] mm: allow deferred page init for vmemmap only

2018-05-15 Thread Pavel Tatashin
Hi Michal, Thank you for your reply, my comments below: > You are now disabling a potentially useful feature to SPARSEMEM users > without having any evidence that they do suffer from the issue which is > kinda sad. Especially when the only known offender is a UP pcp allocator > implementation.

Re: [PATCH v4 1/1] drivers core: multi-threading device shutdown

2018-05-14 Thread Pavel Tatashin
Hi Andy, Thank you for your comments. I will send an updated patch soon. My replies are below: On 05/14/2018 04:04 PM, Andy Shevchenko wrote: > Can we still preserve an order here? (Yes, even if the entire list is > not fully ordered) > In the context I see it would go before netdevice.h.

<    7   8   9   10   11   12   13   14   15   16   >