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 inte

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 > > >&g

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 be > >&g

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:

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" <pet...@infradead.org> > > To: "Paolo Bonzini" <pbonz...@redhat.com> > > Cc: "Marcelo Tosatti" <mt

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

[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 <mtosa...@redhat.com> --- arch/x86/include/asm/kvm_host.h |4 arch/x86/include/uapi/asm/kvm.h |5 + arch/x86/kvm/x86.c | 29 + includ

[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 <mtosa...@redhat.com> --- Documentation/virtual/kvm/hypercalls.txt | 22 +++ arch/x86/kvm/x86.c

[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 <mtosa.

[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 <mtosa...@redhat.com>

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

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

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

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 <mtosa...@redhat.com> wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has

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 <mtosa...@redhat.com> wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has

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

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

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 problem

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

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 ev

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 a

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

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 <mtosa...@redhat.com> --- linux/mm/vmstat.c.sothresh 2017-05-03 11:01:17.465914562

[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 <mtosa...@redhat.com> --- include/linux/vmstat.h |1 - mm/vmstat.c| 25 - 2 files changed, 26 deletions(-) Index: linux-2.6-git-disable-vmstat-worker/include/linux/vm

[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 <mtosa...@redhat.

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 <mtosa...@redhat.com> wrote: > > > > I have several questions about the tunables: > > > > > > - What does the vmstat_thres

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 <mtosa...@redhat.com> wrote: > > > The per-CPU vmstat worker is a problem on -RT workloads (because > > ideally the CPU is entirely reserv

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 <mtosa...@redhat.com> --- include/linux/vmstat.h |1 - mm/vmstat.c| 25 - 2 files changed, 26 deletions(-) Index: linux-2.6-git-disable-vmstat-worker/include/linux/vm

[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

[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 <mtosa...@redhat.com> --- Documentation/vm/vmstat_thresholds.txt | 38 + mm/vmstat.c| 248 +++-- 2 files changed, 272 insertions(+), 14 deletions(-) Index: linux-2

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 <mtosa...@redhat.com> wrote: > > On Thu, Mar 23, 2017 at 06:24:19PM +0100, David Hildenbrand wrote: > >> No caller currently checks the return value of > &

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

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

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

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 al

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 &l

[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 <mtosa...@redhat.com> --- Documentation/virtual/kvm/hypercalls.txt | 45 +++ arch/x86/kvm

[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 <mtosa...@redhat.com> --- drivers/cpufreq/cpufreq_userspace.c | 172 include/linux/cpu

[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 <mtosa...@redhat.com> --- arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/include/uapi/asm/kvm.h |5 + ar

[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

[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 <mtosa...@redhat.com> --- 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)

[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

[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 <mtosa...@redhat.com> --- arch/x86/kvm/x86.c | 36 1 file changed, 36 insertions(+) v2: unify nsec_base (Radim) Index: kvm-ptpdrive

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

2017-01-24 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- 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

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

2017-01-24 Thread Marcelo Tosatti
Add a hypercall to retrieve the host realtime clock and the TSC value used to calculate that clock read. Used to implement clock synchronization between host and guest. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- Documentation/virtual/kvm/hypercalls.txt

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-24 Thread Marcelo Tosatti
On Mon, Jan 23, 2017 at 08:44:53PM +0100, Paolo Bonzini wrote: > > > On 23/01/2017 19:44, Richard Cochran wrote: > >> device clock |sample1P,deviceclock| |sample2P,deviceclock| > >> - > >> realtime clock

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-23 Thread Marcelo Tosatti
On Mon, Jan 23, 2017 at 07:44:15PM +0100, Richard Cochran wrote: > On Mon, Jan 23, 2017 at 11:19:17AM -0200, Marcelo Tosatti wrote: > > This is needed to generate the PTP_SYS_OFFSET data: a table with read > > from realtime clock, read from device clock, read from

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-23 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 09:25:02PM +0100, Richard Cochran wrote: > On Fri, Jan 20, 2017 at 10:20:29AM -0200, Marcelo Tosatti wrote: > > Emulate PTP_SYS_OFFSET by using an arithmetic mean of the > > realtime samples from ->getcrosststamp callback. > > This change log

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 07:08:49PM +0100, Radim Krcmar wrote: > 2017-01-20 13:00-0200, Marcelo Tosatti: > > On Fri, Jan 20, 2017 at 03:12:56PM +0100, Radim Krcmar wrote: > >> 2017-01-20 10:20-0200, Marcelo Tosatti: > >> > +do { > >> > +

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 03:12:56PM +0100, Radim Krcmar wrote: > 2017-01-20 10:20-0200, Marcelo Tosatti: > > Add a driver with gettime method returning hosts realtime clock. > > This allows Chrony to synchronize host and guest clocks with > > high precision (see results bel

[patch 5/5] PTP: add kvm PTP driver (v2)

2017-01-20 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- drivers/ptp/Kconfig | 12 +++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 177 ++ 3 files changed, 190 insertions(+) v2: check for kvmclock (Radim) initialize global

[patch 0/5] KVM virtual PTP driver (v4)

2017-01-20 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 v3 Patch3: v2: export kvmclock clocksource structure directly (Paolo) Patch4: v2: drop timekeeper spinlock, move back to

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 02:36:40PM +0100, Paolo Bonzini wrote: > > > On 20/01/2017 14:07, Marcelo Tosatti wrote: > > On Fri, Jan 20, 2017 at 01:55:27PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 20/01/2017 13:20, Marcelo Tosatti wrote: >

[patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Marcelo Tosatti
ion), that should not be a problem. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- drivers/ptp/ptp_chardev.c | 73 ++ drivers/ptp/ptp_clock.c | 10 ++ 2 files changed, 83 insertions(+) v2: drop timekeeper spinlock, move back t

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

2017-01-20 Thread Marcelo Tosatti
To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- 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)

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

2017-01-20 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- drivers/ptp/Kconfig | 12 +++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 179 ++ 3 files changed, 192 insertions(+) v2: check for kvmclock (Radim) initialize global

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

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

[patch 2/5] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-20 Thread Marcelo Tosatti
Add a hypercall to retrieve the host realtime clock and the TSC value used to calculate that clock read. Used to implement clock synchronization between host and guest. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- Documentation/virtual/kvm/hypercalls.txt

Re: [patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 01:55:27PM +0100, Paolo Bonzini wrote: > > > On 20/01/2017 13:20, Marcelo Tosatti wrote: > > kernel/time/timekeeping.c| 79 > > +++ > > Why not leave this in drivers/ptp/ptp_

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

2017-01-20 Thread Marcelo Tosatti
On Fri, Jan 20, 2017 at 01:58:33PM +0100, Paolo Bonzini wrote: > > > On 20/01/2017 13:20, Marcelo Tosatti wrote: > > + ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, > > +clock_off_gpa, > > +

[patch 4/5] PTP: add PTP_SYS_OFFSET emulation via cross timestamps infrastructure

2017-01-20 Thread Marcelo Tosatti
Emulate PTP_SYS_OFFSET by using an arithmetic mean of the realtime samples from ->getcrosststamp callback. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- drivers/ptp/ptp_chardev.c|6 ++ include/linux/ptp_clock_kernel.h |5 ++ include/linux/timekeeping_ptp.

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

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

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

2017-01-20 Thread Marcelo Tosatti
To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- arch/x86/include/asm/kvmclock.h |6 ++ arch/x86/kernel/kvmclock.c |6 ++ 2 files changed, 12 insertions(+) Index: kvm-ptpdriver/arch/x86/include/asm/kvmc

[patch 2/5] KVM: x86: add KVM_HC_CLOCK_OFFSET hypercall

2017-01-20 Thread Marcelo Tosatti
Add a hypercall to retrieve the host realtime clock and the TSC value used to calculate that clock read. Used to implement clock synchronization between host and guest. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- Documentation/virtual/kvm/hypercalls.txt

[patch 0/5] KVM virtual PTP driver (v3)

2017-01-20 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 v2 Cross timestamping, emulation of PTP_SYS_OFFSET with cross timestamping (Paolo, Miroslav, Radim). Changelog from v1

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

2017-01-20 Thread Marcelo Tosatti
ock. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- drivers/ptp/Kconfig | 12 ++ drivers/ptp/Makefile |1 drivers/ptp/ptp_kvm.c | 213 ++ 3 files changed, 226 insertions(+) v2: check for kvmclock (Radim) initialize global

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

2017-01-20 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 04:45:07PM +0100, Paolo Bonzini wrote: > > > On 18/01/2017 15:50, Marcelo Tosatti wrote: > >> Interesting idea! For this to work, KVM needs to implement > >> getcrosstimestamp and ptp_chardev.c can then add an alternative > >> imp

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

2017-01-20 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 04:20:33PM +0100, Radim Krcmar wrote: > 2017-01-18 12:53-0200, Marcelo Tosatti: > > GOn Wed, Jan 18, 2017 at 12:37:25PM -0200, Marcelo Tosatti wrote: > > > On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: > > > > > > >

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

2017-01-18 Thread Marcelo Tosatti
On Wed, Jan 18, 2017 at 03:02:23PM +0100, Paolo Bonzini wrote: > > > On 18/01/2017 14:36, Miroslav Lichvar wrote: > > On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: > >> On 18/01/2017 13:24, Marcelo Tosatti wrote: > >>>> Testcase: run a gu

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

2017-01-18 Thread Marcelo Tosatti
GOn Wed, Jan 18, 2017 at 12:37:25PM -0200, Marcelo Tosatti wrote: > On Wed, Jan 18, 2017 at 01:46:58PM +0100, Paolo Bonzini wrote: > > > > > > On 18/01/2017 13:24, Marcelo Tosatti wrote: > > > On Wed, Jan 18, 2017 at 10:17:38AM -0200, Marcelo Tosatti wrote: > &

  1   2   3   4   5   6   7   8   9   10   >