Re: [PATCH v4 2/5] KVM: LAPIC: inject lapic timer interrupt by posted interrupt

2019-06-25 Thread Marcelo Tosatti
On Mon, Jun 24, 2019 at 04:53:53PM +0800, Wanpeng Li wrote: > On Sat, 22 Jun 2019 at 06:11, Marcelo Tosatti wrote: > > > > On Fri, Jun 21, 2019 at 09:42:39AM +0800, Wanpeng Li wrote: > > > On Thu, 20 Jun 2019 at 05:04, Marcelo Tosatti wrote: > > > > > >

Re: [PATCH v4 2/5] KVM: LAPIC: inject lapic timer interrupt by posted interrupt

2019-06-21 Thread Marcelo Tosatti
On Fri, Jun 21, 2019 at 09:42:39AM +0800, Wanpeng Li wrote: > On Thu, 20 Jun 2019 at 05:04, Marcelo Tosatti wrote: > > > > Hi Li, > > > > On Wed, Jun 19, 2019 at 08:36:06AM +0800, Wanpeng Li wrote: > > > On Tue, 18 Jun 2019 at 21:36, Marcelo Tosatti wrote: >

Re: [PATCH v4 2/5] KVM: LAPIC: inject lapic timer interrupt by posted interrupt

2019-06-19 Thread Marcelo Tosatti
Hi Li, On Wed, Jun 19, 2019 at 08:36:06AM +0800, Wanpeng Li wrote: > On Tue, 18 Jun 2019 at 21:36, Marcelo Tosatti wrote: > > > > On Mon, Jun 17, 2019 at 07:24:44PM +0800, Wanpeng Li wrote: > > > From: Wanpeng Li > > > > > > Dedicated instances are cur

Re: [PATCH v4 2/5] KVM: LAPIC: inject lapic timer interrupt by posted interrupt

2019-06-18 Thread Marcelo Tosatti
> Avg time > > EXTERNAL_INTERRUPT6871 9.29% 2.96% 0.44us57.88us 0.72us ( > +- 4.02% ) > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Marcelo Tosatti > Signed-off-by: Wanpeng Li > --- > arch/x86/kvm/lapic.c| 33

Re: [PATCH v3 2/4] KVM: LAPIC: lapic timer interrupt is injected by posted interrupt

2019-06-13 Thread Marcelo Tosatti
On Wed, Jun 12, 2019 at 05:22:31PM +0200, Radim Krčmář wrote: > 2019-06-12 09:48+0800, Wanpeng Li: > > On Wed, 12 Jun 2019 at 04:39, Marcelo Tosatti wrote: > > > On Tue, Jun 11, 2019 at 08:17:07PM +0800, Wanpeng Li wrote: > > > > From: Wanpeng Li > > > >

Re: [PATCH v3 1/4] KVM: LAPIC: Make lapic timer unpinned when timer is injected by pi

2019-06-12 Thread Marcelo Tosatti
On Wed, Jun 12, 2019 at 08:45:10AM +0800, Wanpeng Li wrote: > On Wed, 12 Jun 2019 at 04:39, Marcelo Tosatti wrote: > > > > On Tue, Jun 11, 2019 at 08:17:06PM +0800, Wanpeng Li wrote: > > > From: Wanpeng Li > > > > > > Make lapic timer unpinned

Re: [PATCH v3 1/4] KVM: LAPIC: Make lapic timer unpinned when timer is injected by pi

2019-06-11 Thread Marcelo Tosatti
On Tue, Jun 11, 2019 at 08:17:06PM +0800, Wanpeng Li wrote: > From: Wanpeng Li > > Make lapic timer unpinned when timer is injected by posted-interrupt, > the emulated timer can be offload to the housekeeping cpus. > > The host admin should fine tuned, e.g. dedicated instances scenario > w/ noh

Re: [PATCH v3 2/4] KVM: LAPIC: lapic timer interrupt is injected by posted interrupt

2019-06-11 Thread Marcelo Tosatti
On Tue, Jun 11, 2019 at 08:17:07PM +0800, Wanpeng Li wrote: > From: Wanpeng Li > > Dedicated instances are currently disturbed by unnecessary jitter due > to the emulated lapic timers fire on the same pCPUs which vCPUs resident. > There is no hardware virtual timer on Intel for guest like ARM. B

Re: [PATCH] timers: Fix up get_target_base() to use old base properly

2019-06-06 Thread Marcelo Tosatti
oes not suite for a new one". Hi Peter, I think its a dead parameter: you always want to use the local base if the timer is not pinned. > CC: Thomas Gleixner > CC: John Stultz > CC: Stephen Boyd > CC: Luiz Capitulino > CC: Marcelo Tosatti > CC: linux-kernel@vger.kernel.o

Re: [patch 2/3] timers: do not raise softirq unconditionally (spinlockless version)

2019-06-06 Thread Marcelo Tosatti
On Tue, Jun 04, 2019 at 02:29:31PM +0800, Peter Xu wrote: > On Mon, Apr 15, 2019 at 05:12:15PM -0300, Marcelo Tosatti wrote: > > Check base->pending_map locklessly and skip raising timer softirq > > if empty. > > > > What allows the lockless (and potentially racy ag

Re: [patch 0/3] do not raise timer softirq unconditionally (spinlockless version)

2019-05-30 Thread Marcelo Tosatti
ode and then tried to understand the commit > messages. It is easier, if it works the other way round. Right. Commit message seemed descriptive to me, but i should probably try to improve the explanation in the commit message. > On Mon, 15 Apr 2019, Marcelo Tosatti wrote: > > > For isolat

Re: [patch 1/3] timers: raise timer softirq on __mod_timer/add_timer_on

2019-05-30 Thread Marcelo Tosatti
Hi Anna-Maria, On Wed, May 29, 2019 at 04:53:05PM +0200, Anna-Maria Gleixner wrote: > On Mon, 15 Apr 2019, Marcelo Tosatti wrote: > > [...] > > > The patch "timers: do not raise softirq unconditionally" from Thomas > > attempts to address that by checki

Re: [patch 2/3] timers: do not raise softirq unconditionally (spinlockless version)

2019-05-30 Thread Marcelo Tosatti
On Wed, May 29, 2019 at 04:53:26PM +0200, Anna-Maria Gleixner wrote: > On Mon, 15 Apr 2019, Marcelo Tosatti wrote: > > > Check base->pending_map locklessly and skip raising timer softirq > > if empty. > > > > What allows the lockless (and potentially racy agai

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-17 Thread Marcelo Tosatti
On Thu, May 16, 2019 at 09:32:06PM -0700, Ankur Arora wrote: > On 2019-05-15 1:43 p.m., Marcelo Tosatti wrote: > >On Wed, May 15, 2019 at 11:42:56AM -0700, Ankur Arora wrote: > >>On 5/14/19 6:50 AM, Marcelo Tosatti wrote: > >>>On Mon, May 13, 2019 at 05:20:37PM +08

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-16 Thread Marcelo Tosatti
On Wed, May 15, 2019 at 11:42:56AM -0700, Ankur Arora wrote: > On 5/14/19 6:50 AM, Marcelo Tosatti wrote: > >On Mon, May 13, 2019 at 05:20:37PM +0800, Wanpeng Li wrote: > >>On Wed, 8 May 2019 at 02:57, Marcelo Tosatti wrote: > >>> > >>> > >>&

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-15 Thread Marcelo Tosatti
On Wed, May 15, 2019 at 09:42:48AM +0800, Wanpeng Li wrote: > On Wed, 15 May 2019 at 02:20, Marcelo Tosatti wrote: > > > > On Tue, May 14, 2019 at 11:20:15AM -0400, Konrad Rzeszutek Wilk wrote: > > > On Tue, May 14, 2019 at 10:50:23AM -0300, Marcelo Tosatti wrote: > &g

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-14 Thread Marcelo Tosatti
On Tue, May 14, 2019 at 11:20:15AM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, May 14, 2019 at 10:50:23AM -0300, Marcelo Tosatti wrote: > > On Mon, May 13, 2019 at 05:20:37PM +0800, Wanpeng Li wrote: > > > On Wed, 8 May 2019 at 02:57, Marcelo Tosatti wrote: > > >

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-14 Thread Marcelo Tosatti
On Mon, May 13, 2019 at 05:20:37PM +0800, Wanpeng Li wrote: > On Wed, 8 May 2019 at 02:57, Marcelo Tosatti wrote: > > > > > > Certain workloads perform poorly on KVM compared to baremetal > > due to baremetal's ability to perform mwait on NEED_RESCHED > > bit

Re: [PATCH] sched: introduce configurable delay before entering idle

2019-05-07 Thread Marcelo Tosatti
On Wed, May 08, 2019 at 12:15:19AM +0200, Peter Zijlstra wrote: > On Tue, May 07, 2019 at 03:56:49PM -0300, Marcelo Tosatti wrote: > > > > Certain workloads perform poorly on KVM compared to baremetal > > due to baremetal's ability to perform mwait on NEED_RESCHED > &

[PATCH] sched: introduce configurable delay before entering idle

2019-05-07 Thread Marcelo Tosatti
Host: 31.814230202231556 Guest: 38.1771876513 (83 %) Guest, idle_spin=50us: 33.31770989804 (95 %) Guest, idle_spin=220us: 32.2782655149 (98 %) Signed-off-by: Marcelo Tosatti --- kernel/sched/idle.c |

Re: [patch 0/3] do not raise timer softirq unconditionally (spinlockless version)

2019-05-05 Thread Marcelo Tosatti
On Mon, Apr 15, 2019 at 05:12:13PM -0300, Marcelo Tosatti wrote: > For isolated CPUs, we'd like to skip awakening ktimersoftd > (the switch to and then back from ktimersoftd takes 10us in > virtualized environments, in addition to other OS overhead, > which exceeds telco requir

Re: [patch 0/3] do not raise timer softirq unconditionally (spinlockless version)

2019-04-15 Thread Marcelo Tosatti
On Mon, Apr 15, 2019 at 05:12:13PM -0300, Marcelo Tosatti wrote: > For isolated CPUs, we'd like to skip awakening ktimersoftd > (the switch to and then back from ktimersoftd takes 10us in > virtualized environments, in addition to other OS overhead, > which exceeds telco requir

[patch 3/3] timers: condense pending bitmap information

2019-04-15 Thread Marcelo Tosatti
Condense the pending bitmap information in a bool. Improves cyclictest results by 4us. Signed-off-by: Marcelo Tosatti --- kernel/time/timer.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: linux-rt-devel/kernel/time/timer.c

[patch 1/3] timers: raise timer softirq on __mod_timer/add_timer_on

2019-04-15 Thread Marcelo Tosatti
etween timer addition and timer interrupt execution by unconditionally (in case of isolated CPUs) raising the timer softirq after making sure the updated bitmap is visible on remote CPUs. This patch reduces cyclictest latency from 25us to 14us on my testbox. Signed-off-by: Marcelo

[patch 2/3] timers: do not raise softirq unconditionally (spinlockless version)

2019-04-15 Thread Marcelo Tosatti
Check base->pending_map locklessly and skip raising timer softirq if empty. What allows the lockless (and potentially racy against mod_timer) check is that mod_timer will raise another timer softirq after modifying base->pending_map. Signed-off-by: Marcelo Tosatti --- kernel/time/t

[patch 0/3] do not raise timer softirq unconditionally (spinlockless version)

2019-04-15 Thread Marcelo Tosatti
For isolated CPUs, we'd like to skip awakening ktimersoftd (the switch to and then back from ktimersoftd takes 10us in virtualized environments, in addition to other OS overhead, which exceeds telco requirements for packet forwarding for 5G) from the sched tick. The patch "timers: do not raise sof

Re: [patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support

2018-10-08 Thread Marcelo Tosatti
On Sat, Oct 06, 2018 at 03:28:05PM -0700, Andy Lutomirski wrote: > On Sat, Oct 6, 2018 at 1:29 PM Marcelo Tosatti wrote: > > > > On Thu, Oct 04, 2018 at 03:15:32PM -0700, Andy Lutomirski wrote: > > > For better or for worse, I'm trying to understand this code. So

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-29 Thread Marcelo Tosatti
On Fri, Sep 29, 2017 at 07:05:41PM +0200, Paolo Bonzini wrote: > On 29/09/2017 18:40, Marcelo Tosatti wrote: > >> If you know you have this kind disk workload, you must use virtio-blk or > >> virtio-scsi with iothreads and place the iothreads on their own physical > >&

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-29 Thread Marcelo Tosatti
On Fri, Sep 29, 2017 at 10:18:25AM +0200, Paolo Bonzini wrote: > On 28/09/2017 23:35, Marcelo Tosatti wrote: > > On Thu, Sep 28, 2017 at 09:22:02AM +0200, Paolo Bonzini wrote: > >> On 28/09/2017 02:44, Marcelo Tosatti wrote: > >>>> Again: if you have many interru

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-28 Thread Marcelo Tosatti
On Thu, Sep 28, 2017 at 06:35:08PM -0300, Marcelo Tosatti wrote: > On Thu, Sep 28, 2017 at 09:22:02AM +0200, Paolo Bonzini wrote: > > On 28/09/2017 02:44, Marcelo Tosatti wrote: > > >> Again: if you have many interruptions, it's not a flaw in KVM or QEMU's > >

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-28 Thread Marcelo Tosatti
On Thu, Sep 28, 2017 at 09:22:02AM +0200, Paolo Bonzini wrote: > On 28/09/2017 02:44, Marcelo Tosatti wrote: > >> Again: if you have many interruptions, it's not a flaw in KVM or QEMU's > >> design, it's just that someone is doing something stupid. It could

Re: [patch 0/3] KVM KVM_HC_RT_PRIO hypercall support

2017-09-27 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 08:23:02AM +0200, Jan Kiszka wrote: > On 2017-09-22 03:19, Marcelo Tosatti wrote: > > On Thu, Sep 21, 2017 at 07:45:32PM +0200, Jan Kiszka wrote: > >> On 2017-09-21 13:38, Marcelo Tosatti wrote: > >>> When executing guest vcpu-0 with FIFO:1 p

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-27 Thread Marcelo Tosatti
On Wed, Sep 27, 2017 at 11:37:48AM +0200, Paolo Bonzini wrote: > On 27/09/2017 00:49, Marcelo Tosatti wrote: > > On Mon, Sep 25, 2017 at 05:12:42PM +0200, Paolo Bonzini wrote: > >> On 25/09/2017 11:13, Peter Zijlstra wrote: > >>> On Sun, Sep 24, 2017 at 11:57:53P

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-26 Thread Marcelo Tosatti
On Mon, Sep 25, 2017 at 05:12:42PM +0200, Paolo Bonzini wrote: > On 25/09/2017 11:13, Peter Zijlstra wrote: > > On Sun, Sep 24, 2017 at 11:57:53PM -0300, Marcelo Tosatti wrote: > >> I think you are missing the following point: > >> > >> "vcpu0 can

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-26 Thread Marcelo Tosatti
On Mon, Sep 25, 2017 at 11:13:16AM +0200, Peter Zijlstra wrote: > On Sun, Sep 24, 2017 at 11:57:53PM -0300, Marcelo Tosatti wrote: > > I think you are missing the following point: > > > > "vcpu0 can be interrupted when its not in a spinlock protected section, > >

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-24 Thread Marcelo Tosatti
On Sun, Sep 24, 2017 at 09:05:44AM -0400, Paolo Bonzini wrote: > > > - Original Message - > > From: "Peter Zijlstra" > > To: "Paolo Bonzini" > > Cc: "Marcelo Tosatti" , "Konrad Rzeszutek Wilk" > > , mi...@re

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-24 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 02:59:51PM +0200, Peter Zijlstra wrote: > On Fri, Sep 22, 2017 at 09:36:39AM -0300, Marcelo Tosatti wrote: > > On Fri, Sep 22, 2017 at 02:31:07PM +0200, Peter Zijlstra wrote: > > > On Fri, Sep 22, 2017 at 09:16:40AM -0300, Marcelo Tosatti wrote: > >

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-24 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 03:01:41PM +0200, Peter Zijlstra wrote: > On Fri, Sep 22, 2017 at 09:40:05AM -0300, Marcelo Tosatti wrote: > > > Are you arguing its invalid for the following application to execute on > > housekeeping vcpu of a realtime system: >

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall\

2017-09-22 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 02:31:07PM +0200, Peter Zijlstra wrote: > On Fri, Sep 22, 2017 at 09:16:40AM -0300, Marcelo Tosatti wrote: > > On Fri, Sep 22, 2017 at 12:00:05PM +0200, Peter Zijlstra wrote: > > > On Thu, Sep 21, 2017 at 10:10:41PM -0300, Marcelo Tosatti wrote: > >

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-22 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 12:56:09PM +0200, Peter Zijlstra wrote: > On Fri, Sep 22, 2017 at 12:00:04PM +0200, Peter Zijlstra wrote: > > On Thu, Sep 21, 2017 at 10:10:41PM -0300, Marcelo Tosatti wrote: > > > When executing guest vcpu-0 with FIFO:1 priority, which is necessary > &

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-22 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 02:31:07PM +0200, Peter Zijlstra wrote: > On Fri, Sep 22, 2017 at 09:16:40AM -0300, Marcelo Tosatti wrote: > > On Fri, Sep 22, 2017 at 12:00:05PM +0200, Peter Zijlstra wrote: > > > On Thu, Sep 21, 2017 at 10:10:41PM -0300, Marcelo Tosatti wrote: > >

Re: [patch 2/3] KVM: x86: KVM_HC_RT_PRIO hypercall (host-side)

2017-09-22 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 09:23:47AM +0200, Paolo Bonzini wrote: > On 22/09/2017 03:08, Marcelo Tosatti wrote: > > On Thu, Sep 21, 2017 at 03:49:33PM +0200, Paolo Bonzini wrote: > >> On 21/09/2017 15:32, Konrad Rzeszutek Wilk wrote: > >>> So the guest can change the sc

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-22 Thread Marcelo Tosatti
On Fri, Sep 22, 2017 at 12:00:05PM +0200, Peter Zijlstra wrote: > On Thu, Sep 21, 2017 at 10:10:41PM -0300, Marcelo Tosatti wrote: > > When executing guest vcpu-0 with FIFO:1 priority, which is necessary > > to > > deal with the following situation: > > &g

Re: [patch 0/3] KVM KVM_HC_RT_PRIO hypercall support

2017-09-21 Thread Marcelo Tosatti
On Thu, Sep 21, 2017 at 07:45:32PM +0200, Jan Kiszka wrote: > On 2017-09-21 13:38, Marcelo Tosatti wrote: > > When executing guest vcpu-0 with FIFO:1 priority, which is necessary to > > deal with the following situation: > > > > VCPU-0 (housekeeping VCPU)

Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-21 Thread Marcelo Tosatti
On Thu, Sep 21, 2017 at 04:06:28PM +0200, Peter Zijlstra wrote: > On Thu, Sep 21, 2017 at 09:36:53AM -0400, Konrad Rzeszutek Wilk wrote: > > On Thu, Sep 21, 2017 at 08:38:38AM -0300, Marcelo Tosatti wrote: > > > Add hypercalls to spinlock/unlock to set/unset FIFO priority

Re: [patch 2/3] KVM: x86: KVM_HC_RT_PRIO hypercall (host-side)

2017-09-21 Thread Marcelo Tosatti
On Thu, Sep 21, 2017 at 03:49:33PM +0200, Paolo Bonzini wrote: > On 21/09/2017 15:32, Konrad Rzeszutek Wilk wrote: > > So the guest can change the scheduling decisions at the host level? > > And the host HAS to follow it? There is no policy override for the > > host to say - nah, not going to do it

[patch 1/3] KVM: x86: add per-vcpu option to set guest vcpu -RT priority

2017-09-21 Thread Marcelo Tosatti
isable ability to use the hypercall, on a per-vcpu basis. Signed-off-by: Marcelo Tosatti --- arch/x86/include/asm/kvm_host.h |4 arch/x86/include/uapi/asm/kvm.h |5 + arch/x86/kvm/x86.c | 29 + include/uapi/linux/kvm.h

[patch 2/3] KVM: x86: KVM_HC_RT_PRIO hypercall (host-side)

2017-09-21 Thread Marcelo Tosatti
DPDK should not enter the kernel (and housekeeping vcpu performance is far from a key factor). Signed-off-by: Marcelo Tosatti --- Documentation/virtual/kvm/hypercalls.txt | 22 +++ arch/x86/kvm/x86.c | 43 +++ include/uapi/linux

[patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall

2017-09-21 Thread Marcelo Tosatti
Add hypercalls to spinlock/unlock to set/unset FIFO priority for the vcpu, protected by a static branch to avoid performance increase in the normal kernels. Enable option by "kvmfifohc" kernel command line parameter (disabled by default). Signed-off-by: Marcelo Tosatti --- arch/

[patch 0/3] KVM KVM_HC_RT_PRIO hypercall support

2017-09-21 Thread Marcelo Tosatti
DPDK should not enter the kernel (and housekeeping vcpu performance is far from a key factor). Signed-off-by: Marcelo Tosatti

Re: [PATCH v4 07/10] KVM: x86: remove not used pvclock_gtod_copy

2017-08-11 Thread Marcelo Tosatti
On Thu, Aug 03, 2017 at 02:35:19PM +0200, Paolo Bonzini wrote: > On 03/08/2017 01:21, Marcelo Tosatti wrote: > >> - if (ka->use_master_clock || > >> - (gtod->clock.vclock_mode == VCLOCK_TSC && vcpus_matched)) > >> + if (ka->use_master_clock ||

Re: [PATCH v4 09/10] pvclock: add clocksource change notification on changing of tsc stable bit

2017-08-02 Thread Marcelo Tosatti
On Wed, Aug 02, 2017 at 05:38:09PM +0300, Denis Plotnikov wrote: > It's needed to notify the KVM guest about critical changes in pvclock > and make it to update its masterclock. > > This is a part of the work aiming to make kvmclock be a clocksource > providing valid cycles value for KVM masterclo

Re: [PATCH v4 07/10] KVM: x86: remove not used pvclock_gtod_copy

2017-08-02 Thread Marcelo Tosatti
Hi Denis, I'm all for this as well, the original submission suggested something similar, someone said "use a scheme similar to vsyscalls", therefore the internal copy of the fields. More comments below. On Wed, Aug 02, 2017 at 05:38:07PM +0300, Denis Plotnikov wrote: > Since, KVM has been swit

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-07-11 Thread Marcelo Tosatti
On Tue, May 30, 2017 at 01:17:41PM -0500, Christoph Lameter wrote: > On Fri, 26 May 2017, Marcelo Tosatti wrote: > > > > interrupts and scheduler ticks. But what does this have to do with vmstat? > > > > > > Show me your dpdk code running and trace the tick on /

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-30 Thread Marcelo Tosatti
On Thu, Jun 29, 2017 at 09:03:42PM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 12:15 PM, Marcelo Tosatti wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has odd semantics that are not

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-30 Thread Marcelo Tosatti
On Thu, Jun 29, 2017 at 09:03:42PM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 12:15 PM, Marcelo Tosatti wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has odd semantics that are not

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Marcelo Tosatti
On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 6:46 AM, Thomas Gleixner wrote: > > On Thu, 29 Jun 2017, Greg KH wrote: > >> On Thu, Jun 29, 2017 at 03:05:26PM +0200, Thomas Gleixner wrote: > >> > > >> > And who defined that it should not be used in real c

Re: [PATCH] KVM: x86: update master clock before computing kvmclock_offset

2017-05-30 Thread Marcelo Tosatti
On Tue, May 16, 2017 at 10:50:00PM +0200, Radim Krčmář wrote: > kvm master clock usually has a different frequency than the kernel boot > clock. This is not a problem until the master clock is updated; > update uses the current kernel boot clock to compute new kvm clock, > which erases any kvm clo

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-26 Thread Marcelo Tosatti
On Thu, May 25, 2017 at 10:24:46PM -0500, Christoph Lameter wrote: > On Thu, 25 May 2017, Marcelo Tosatti wrote: > > > Argument? We're showing you the data that this is causing a latency > > problem for us. > > Sorry I am not sure where the data shows a latency pr

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-25 Thread Marcelo Tosatti
On Fri, May 19, 2017 at 01:49:34PM -0400, Luiz Capitulino wrote: > On Fri, 19 May 2017 12:13:26 -0500 (CDT) > Christoph Lameter wrote: > > > > So why are you against integrating this simple, isolated patch which > > > does not affect how current logic works? > > > > Frankly the argument does n

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-22 Thread Marcelo Tosatti
On Mon, May 22, 2017 at 11:38:02AM -0500, Christoph Lameter wrote: > On Sat, 20 May 2017, Marcelo Tosatti wrote: > > > > And you can configure the interval of vmstat updates freely Set > > > the vmstat_interval to 60 seconds instead of 2 for a try? Is that rare > &

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-20 Thread Marcelo Tosatti
On Fri, May 19, 2017 at 12:13:26PM -0500, Christoph Lameter wrote: > On Fri, 19 May 2017, Marcelo Tosatti wrote: > > > Use-case: realtime application on an isolated core which for some reason > > updates vmstatistics. > > Ok that is already only happening every 2 sec

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-19 Thread Marcelo Tosatti
Hi Christoph, On Tue, May 16, 2017 at 08:37:11AM -0500, Christoph Lameter wrote: > On Mon, 15 May 2017, Marcelo Tosatti wrote: > > > > NOHZ already does that. I wanted to know what your problem is that you > > > see. The latency issue has already been solved as far as I

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-15 Thread Marcelo Tosatti
On Fri, May 12, 2017 at 11:57:15AM -0500, Christoph Lameter wrote: > On Fri, 12 May 2017, Marcelo Tosatti wrote: > > > > What exactly is the issue you are seeing and want to address? I think we > > > have similar aims and as far as I know the current situation is alrea

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-12 Thread Marcelo Tosatti
On Fri, May 12, 2017 at 11:07:48AM -0500, Christoph Lameter wrote: > On Fri, 12 May 2017, Marcelo Tosatti wrote: > > > In our case, vmstat updates are very rare (CPU is dominated by DPDK). > > What is the OS doing on the cores that DPDK runs on? I mean we here can > cle

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-12 Thread Marcelo Tosatti
On Fri, May 12, 2017 at 10:11:14AM -0500, Christoph Lameter wrote: > On Fri, 12 May 2017, Marcelo Tosatti wrote: > > > > A bit confused by this one. The vmstat worker is already disabled if there > > > are no updates. Also the patches by Chris Metcalf on data plane mode ad

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-12 Thread Marcelo Tosatti
On Thu, May 11, 2017 at 10:37:07AM -0500, Christoph Lameter wrote: > On Tue, 2 May 2017, Luiz Capitulino wrote: > > > Ah, OK. Got this now. I'll give this patch a try. But I think we want > > to hear from Christoph (who worked on reducing the vmstat interruptions > > in the past). > > A bit confu

Re: [patch 3/3] MM: allow per-cpu vmstat_worker configuration

2017-05-11 Thread Marcelo Tosatti
On Wed, May 10, 2017 at 11:34:26AM -0400, Rik van Riel wrote: > On Wed, 2017-05-03 at 15:40 -0300, Marcelo Tosatti wrote: > > Following the reasoning on the last patch in the series, > > this patch allows configuration of the per-CPU vmstat worker: > > it allows the user t

[patch 3/3] MM: allow per-cpu vmstat_worker configuration

2017-05-03 Thread Marcelo Tosatti
Following the reasoning on the last patch in the series, this patch allows configuration of the per-CPU vmstat worker: it allows the user to disable the per-CPU vmstat worker. Signed-off-by: Marcelo Tosatti --- linux/mm/vmstat.c.sothresh 2017-05-03 11:01:17.465914562 -0300 +++ linux/mm

[patch 0/3] per-CPU vmstat thresholds and vmstat worker disablement (v2)

2017-05-03 Thread Marcelo Tosatti
The per-CPU vmstat worker is a problem on -RT workloads (because ideally the CPU is entirely reserved for the -RT app, without interference). The worker transfers accumulated per-CPU vmstat counters to global counters. To resolve the problem, create two tunables: * Userspace configurable per-CPU

[patch 1/3] MM: remove unused quiet_vmstat function

2017-05-03 Thread Marcelo Tosatti
Remove unused quiet_vmstat function. Signed-off-by: Marcelo Tosatti --- include/linux/vmstat.h |1 - mm/vmstat.c| 25 - 2 files changed, 26 deletions(-) Index: linux-2.6-git-disable-vmstat-worker/include/linux/vmstat.h

[patch 2/3] MM: allow per-cpu vmstat_threshold configuration

2017-05-03 Thread Marcelo Tosatti
threshold: by default the VM code calculates the size of the per-CPU vmstat arrays. This tunable allows userspace to configure the vmstat threshold values. The patch below contains documentation which describes the tunables in more detail. Signed-off-by: Marcelo Tosatti --- Documentation/vm

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-02 Thread Marcelo Tosatti
On Tue, May 02, 2017 at 01:15:27PM -0400, Luiz Capitulino wrote: > On Tue, 2 May 2017 13:52:00 -0300 > Marcelo Tosatti wrote: > > > > I have several questions about the tunables: > > > > > > - What does the vmstat_threshold value mean? What are the implicat

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-05-02 Thread Marcelo Tosatti
On Tue, May 02, 2017 at 10:28:36AM -0400, Luiz Capitulino wrote: > On Tue, 25 Apr 2017 10:57:19 -0300 > Marcelo Tosatti wrote: > > > The per-CPU vmstat worker is a problem on -RT workloads (because > > ideally the CPU is entirely reserved for the -RT app, without > >

Re: [patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-04-25 Thread Marcelo Tosatti
On Tue, Apr 25, 2017 at 03:29:06PM -0400, Rik van Riel wrote: > On Tue, 2017-04-25 at 10:57 -0300, Marcelo Tosatti wrote: > > The per-CPU vmstat worker is a problem on -RT workloads (because > > ideally the CPU is entirely reserved for the -RT app, without > > interference).

[patch 1/2] MM: remove unused quiet_vmstat function

2017-04-25 Thread Marcelo Tosatti
Remove unused quiet_vmstat function. Signed-off-by: Marcelo Tosatti --- include/linux/vmstat.h |1 - mm/vmstat.c| 25 - 2 files changed, 26 deletions(-) Index: linux-2.6-git-disable-vmstat-worker/include/linux/vmstat.h

[patch 0/2] per-CPU vmstat thresholds and vmstat worker disablement

2017-04-25 Thread Marcelo Tosatti
The per-CPU vmstat worker is a problem on -RT workloads (because ideally the CPU is entirely reserved for the -RT app, without interference). The worker transfers accumulated per-CPU vmstat counters to global counters. To resolve the problem, create two tunables: * Userspace configurable per-CPU

[patch 2/2] MM: allow per-cpu vmstat_threshold and vmstat_worker configuration

2017-04-25 Thread Marcelo Tosatti
the tunables in more detail. Signed-off-by: Marcelo Tosatti --- Documentation/vm/vmstat_thresholds.txt | 38 + mm/vmstat.c| 248 +++-- 2 files changed, 272 insertions(+), 14 deletions(-) Index: linux-2.6-git-disable-vmstat-worker/mm

Re: [PATCH v2] KVM: kvm_io_bus_unregister_dev() should never fail

2017-03-24 Thread Marcelo Tosatti
On Fri, Mar 24, 2017 at 09:48:31AM +0100, Dmitry Vyukov wrote: > On Thu, Mar 23, 2017 at 9:42 PM, Marcelo Tosatti wrote: > > On Thu, Mar 23, 2017 at 06:24:19PM +0100, David Hildenbrand wrote: > >> No caller currently checks the return value of > >> kvm_io_bus_unregis

Re: [PATCH v2] KVM: kvm_io_bus_unregister_dev() should never fail

2017-03-23 Thread Marcelo Tosatti
On Thu, Mar 23, 2017 at 06:24:19PM +0100, David Hildenbrand wrote: > No caller currently checks the return value of > kvm_io_bus_unregister_dev(). This is evil, as all callers silently go on > freeing their device. A stale reference will remain in the io_bus, > getting at least used again, when the

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-03-01 Thread Marcelo Tosatti
On Wed, Mar 01, 2017 at 03:21:32PM +0100, Paolo Bonzini wrote: > > > On 28/02/2017 03:45, Marcelo Tosatti wrote: > > On Fri, Feb 24, 2017 at 04:34:52PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 24/02/2017 14:04, Marcelo Tosatti wrote: > >>&g

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-28 Thread Marcelo Tosatti
On Fri, Feb 24, 2017 at 04:34:52PM +0100, Paolo Bonzini wrote: > > > On 24/02/2017 14:04, Marcelo Tosatti wrote: > >>>>> Whats the current usecase, or forseeable future usecase, for > >>>>> save/restore > >>>>> across preemption

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-24 Thread Marcelo Tosatti
On Fri, Feb 24, 2017 at 01:17:07PM +0100, Paolo Bonzini wrote: > > > On 24/02/2017 12:50, Marcelo Tosatti wrote: > >>> > >>> On all other cpufreq implementations, these boundaries still need to > >>> be set. Then, a "governor" must be s

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-24 Thread Marcelo Tosatti
On Fri, Feb 24, 2017 at 10:18:59AM +0100, Paolo Bonzini wrote: > > > On 24/02/2017 00:19, Marcelo Tosatti wrote: > >>> i.e. our feature implies userspace tasks pinned to isolated vCPUs. > > This is how cpufreq-userspace works: > > > > 2.2 Governor > &g

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-23 Thread Marcelo Tosatti
On Thu, Feb 23, 2017 at 06:35:24PM +0100, Paolo Bonzini wrote: > > > On 03/02/2017 20:09, Radim Krcmar wrote: > > One reason why we have a kernel/userspace split is to allow sharing of > > CPU time. Each application then its state that the kernel keeps track > > of and saves/restores while time-

Re: [patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls

2017-02-22 Thread Marcelo Tosatti
On Fri, Feb 03, 2017 at 06:03:37PM +0100, Radim Krcmar wrote: > 2017-02-02 15:47-0200, Marcelo Tosatti: > > For most VMs, modifying the host frequency is an undesired > > operation. Introduce ioctl to enable the guest to > > modify host CPU frequency. > > > > &

Re: [patch 0/3] KVM CPU frequency change hypercalls

2017-02-03 Thread Marcelo Tosatti
On Fri, Feb 03, 2017 at 05:43:50PM +0100, Radim Krcmar wrote: > 2017-02-02 15:47-0200, Marcelo Tosatti: > > Implement KVM hypercalls for the guest > > to issue frequency changes. > > > > Current situation with DPDK and frequency changes is as follows: > > An algor

Re: [patch 3/3] KVM: x86: frequency change hypercalls

2017-02-03 Thread Marcelo Tosatti
On Fri, Feb 03, 2017 at 06:40:34PM +0100, Radim Krcmar wrote: > 2017-02-02 15:47-0200, Marcelo Tosatti: > > Implement min/max/up/down frequency change > > KVM hypercalls. To be used by DPDK implementation. > > > > Also allow such hypercalls from guest userspace. >

Re: [patch 3/3] KVM: x86: frequency change hypercalls

2017-02-02 Thread Marcelo Tosatti
On Thu, Feb 02, 2017 at 03:47:58PM -0200, Marcelo Tosatti wrote: > Implement min/max/up/down frequency change > KVM hypercalls. To be used by DPDK implementation. > > Also allow such hypercalls from guest userspace. > > Signed-off-by: Marcelo Tosatti > > --- >

[patch 3/3] KVM: x86: frequency change hypercalls

2017-02-02 Thread Marcelo Tosatti
Implement min/max/up/down frequency change KVM hypercalls. To be used by DPDK implementation. Also allow such hypercalls from guest userspace. Signed-off-by: Marcelo Tosatti --- Documentation/virtual/kvm/hypercalls.txt | 45 +++ arch/x86/kvm/x86.c

[patch 1/3] cpufreq: implement min/max/up/down functions

2017-02-02 Thread Marcelo Tosatti
driver (intel_pstate=disable host kernel command line option), and set cpufreq userspace governor for the isolated pCPU. Signed-off-by: Marcelo Tosatti --- drivers/cpufreq/cpufreq_userspace.c | 172 include/linux/cpufreq.h |7 + 2 files

[patch 2/3] KVM: x86: introduce ioctl to allow frequency hypercalls

2017-02-02 Thread Marcelo Tosatti
For most VMs, modifying the host frequency is an undesired operation. Introduce ioctl to enable the guest to modify host CPU frequency. Signed-off-by: Marcelo Tosatti --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/include/uapi/asm/kvm.h |5 + arch/x86/kvm/x86.c

[patch 0/3] KVM CPU frequency change hypercalls

2017-02-02 Thread Marcelo Tosatti
Implement KVM hypercalls for the guest to issue frequency changes. Current situation with DPDK and frequency changes is as follows: An algorithm in the guest decides when to increase/decrease frequency based on the queue length of the device. On the host, a power manager daemon is used to listen

Re: [patch 2/4] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-25 Thread Marcelo Tosatti
On Wed, Jan 25, 2017 at 01:59:34PM +0100, Paolo Bonzini wrote: > > > On 25/01/2017 13:55, Marcelo Tosatti wrote: > > On Wed, Jan 25, 2017 at 01:30:49PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 24/01/2017 18:09, Marcelo Tosatti wrote: > >>&g

Re: [patch 4/4] PTP: add kvm PTP driver

2017-01-25 Thread Marcelo Tosatti
On Wed, Jan 25, 2017 at 01:56:45PM +0100, Paolo Bonzini wrote: > > > On 24/01/2017 18:09, Marcelo Tosatti wrote: > > Add a driver with gettime method returning hosts realtime clock. > > This allows Chrony to synchronize host and guest clocks with > > high p

Re: [patch 2/4] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-25 Thread Marcelo Tosatti
On Wed, Jan 25, 2017 at 01:30:49PM +0100, Paolo Bonzini wrote: > > > On 24/01/2017 18:09, Marcelo Tosatti wrote: > > Add a hypercall to retrieve the host realtime clock > > and the TSC value used to calculate that clock read. > > > > Used to implement clock syn

[patch 3/4] kvmclock: export kvmclock clocksource pointer

2017-01-24 Thread Marcelo Tosatti
To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti --- arch/x86/include/asm/kvmclock.h |6 ++ arch/x86/kernel/kvmclock.c |3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) v2: export kvmclock clocksource structure directly (Paolo) Index: kvm-ptpdriver/arch/x86

[patch 0/4] KVM virtual PTP driver (v5)

2017-01-24 Thread Marcelo Tosatti
This patchset implements a virtual PTP driver which allows guest to sync its clock to the host clock with high precision (error is < 1us on an idle guest). Changelog from v4 Drop PTP_SYS_OFFSET emulation via ->crosstimestamp callback (Richard). Emulate ->gettime directly without TSC offset (Radi

[patch 1/4] KVM: x86: provide realtime host clock via vsyscall notifiers

2017-01-24 Thread Marcelo Tosatti
Expose the realtime host clock and save the TSC value used for the clock calculation. Signed-off-by: Marcelo Tosatti --- arch/x86/kvm/x86.c | 36 1 file changed, 36 insertions(+) v2: unify nsec_base (Radim) Index: kvm-ptpdriver/arch/x86/kvm/x86.c

[patch 4/4] PTP: add kvm PTP driver

2017-01-24 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti --- drivers/ptp/Kconfig | 12 ++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 202 ++ 3 files changed, 215 insertions(+) v2: check for kvmclock (Radim) initialize global variables before dev

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