Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-23 Thread Marcelo Tosatti
On Thu, Apr 23, 2015 at 02:02:29PM +0200, Paolo Bonzini wrote: > > > On 23/04/2015 13:51, Marcelo Tosatti wrote: > >>> > > https://bugzilla.redhat.com/show_bug.cgi?id=1174664 > >> > > >> > That was the missing volatile in an asm. Older compilers didn't catch > >> > it. :( > > How do you know th

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-23 Thread Paolo Bonzini
On 23/04/2015 13:51, Marcelo Tosatti wrote: >>> > > https://bugzilla.redhat.com/show_bug.cgi?id=1174664 >> > >> > That was the missing volatile in an asm. Older compilers didn't catch >> > it. :( > How do you know that? It looks like memory corruption (look at the > pattern at the end). I susp

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-23 Thread Marcelo Tosatti
On Thu, Apr 23, 2015 at 11:13:23AM +0200, Paolo Bonzini wrote: > > > On 22/04/2015 23:21, Marcelo Tosatti wrote: > > On Mon, Apr 20, 2015 at 01:27:58PM -0700, Andy Lutomirski wrote: > >> On Mon, Apr 20, 2015 at 9:59 AM, Paolo Bonzini wrote: > >>> > >>> > >>> On 17/04/2015 22:18, Marcelo Tosatti

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-23 Thread Paolo Bonzini
On 23/04/2015 00:55, Marcelo Tosatti wrote: > On Wed, Apr 22, 2015 at 11:01:49PM +0200, Paolo Bonzini wrote: >> >> >> On 22/04/2015 22:56, Marcelo Tosatti wrote: > But then why was the task migration notifier even in Jeremy's original > code for Xen? >>> To cover for the vcpu1 -> vcpu2 -

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-23 Thread Paolo Bonzini
On 22/04/2015 23:21, Marcelo Tosatti wrote: > On Mon, Apr 20, 2015 at 01:27:58PM -0700, Andy Lutomirski wrote: >> On Mon, Apr 20, 2015 at 9:59 AM, Paolo Bonzini wrote: >>> >>> >>> On 17/04/2015 22:18, Marcelo Tosatti wrote: The bug which this is fixing is very rare, have no memory of a repo

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-22 Thread Marcelo Tosatti
On Wed, Apr 22, 2015 at 11:01:49PM +0200, Paolo Bonzini wrote: > > > On 22/04/2015 22:56, Marcelo Tosatti wrote: > >> > But then why was the task migration notifier even in Jeremy's original > >> > code for Xen? > > To cover for the vcpu1 -> vcpu2 -> vcpu1 case, i believe. > > Ok, to cover it f

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-22 Thread Marcelo Tosatti
On Mon, Apr 20, 2015 at 01:27:58PM -0700, Andy Lutomirski wrote: > On Mon, Apr 20, 2015 at 9:59 AM, Paolo Bonzini wrote: > > > > > > On 17/04/2015 22:18, Marcelo Tosatti wrote: > >> The bug which this is fixing is very rare, have no memory of a report. > >> > >> In fact, its even difficult to crea

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-22 Thread Paolo Bonzini
On 22/04/2015 22:56, Marcelo Tosatti wrote: >> > But then why was the task migration notifier even in Jeremy's original >> > code for Xen? > To cover for the vcpu1 -> vcpu2 -> vcpu1 case, i believe. Ok, to cover it for non-synchronized TSC. While KVM requires synchronized TSC. > > If that's t

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-22 Thread Marcelo Tosatti
On Mon, Apr 20, 2015 at 06:59:04PM +0200, Paolo Bonzini wrote: > > > On 17/04/2015 22:18, Marcelo Tosatti wrote: > > The bug which this is fixing is very rare, have no memory of a report. > > > > In fact, its even difficult to create a synthetic reproducer. > > But then why was the task migrati

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-20 Thread Andy Lutomirski
On Mon, Apr 20, 2015 at 9:59 AM, Paolo Bonzini wrote: > > > On 17/04/2015 22:18, Marcelo Tosatti wrote: >> The bug which this is fixing is very rare, have no memory of a report. >> >> In fact, its even difficult to create a synthetic reproducer. > > But then why was the task migration notifier eve

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-20 Thread Paolo Bonzini
On 17/04/2015 22:18, Marcelo Tosatti wrote: > The bug which this is fixing is very rare, have no memory of a report. > > In fact, its even difficult to create a synthetic reproducer. But then why was the task migration notifier even in Jeremy's original code for Xen? Was it supposed to work ev

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-18 Thread Paolo Bonzini
On 18/04/2015 00:25, Andy Lutomirski wrote: >> Isn't the *whole* point of pvclock_clocksource_read() to be a native >> rdtsc with scaling? How does it cause that kind of insane pain? It's possible that your machine ends up with PVCLOCK_TSC_STABLE_BIT clear, so you get an atomic cmpxchg in additi

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Marcelo Tosatti
On Fri, Apr 17, 2015 at 03:25:28PM -0700, Andy Lutomirski wrote: > On Fri, Apr 17, 2015 at 3:04 PM, Linus Torvalds > wrote: > > On Fri, Apr 17, 2015 at 5:42 PM, Andy Lutomirski > > wrote: > >> > >> Muahaha. The auditors have invaded your system. (I did my little > >> benchmark with a more sens

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Andy Lutomirski
On Fri, Apr 17, 2015 at 3:04 PM, Linus Torvalds wrote: > On Fri, Apr 17, 2015 at 5:42 PM, Andy Lutomirski wrote: >> >> Muahaha. The auditors have invaded your system. (I did my little >> benchmark with a more sensible configuration -- see way below). >> >> Can you send the output of: >> >> # au

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Linus Torvalds
On Fri, Apr 17, 2015 at 5:42 PM, Andy Lutomirski wrote: > > Muahaha. The auditors have invaded your system. (I did my little > benchmark with a more sensible configuration -- see way below). > > Can you send the output of: > > # auditctl -s > # auditctl -l # auditctl -s enabled 1 flag 1

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Andy Lutomirski
On Fri, Apr 17, 2015 at 2:28 PM, Linus Torvalds wrote: > On Fri, Apr 17, 2015 at 4:39 PM, Andy Lutomirski wrote: >> >> On my box, vclock_gettime using kvm-clock is about 40 ns. An empty >> syscall is about 33 ns. clock_gettime *should* be around 17 ns. >> >> The clock_gettime syscall is about 7

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Linus Torvalds
On Fri, Apr 17, 2015 at 4:39 PM, Andy Lutomirski wrote: > > On my box, vclock_gettime using kvm-clock is about 40 ns. An empty > syscall is about 33 ns. clock_gettime *should* be around 17 ns. > > The clock_gettime syscall is about 73 ns. > > Could we figure out why clock_gettime (the syscall) i

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Andy Lutomirski
On Fri, Apr 17, 2015 at 1:18 PM, Marcelo Tosatti wrote: > On Fri, Apr 17, 2015 at 09:57:12PM +0200, Paolo Bonzini wrote: >> >> >> >> From 4eb9d7132e1990c0586f28af3103675416d38974 Mon Sep 17 00:00:00 2001 >> >> From: Paolo Bonzini >> >> Date: Fri, 17 Apr 2015 14:57:34 +0200 >> >> Subject: [PATCH]

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Marcelo Tosatti
On Fri, Apr 17, 2015 at 09:57:12PM +0200, Paolo Bonzini wrote: > > > >> From 4eb9d7132e1990c0586f28af3103675416d38974 Mon Sep 17 00:00:00 2001 > >> From: Paolo Bonzini > >> Date: Fri, 17 Apr 2015 14:57:34 +0200 > >> Subject: [PATCH] sched: add CONFIG_TASK_MIGRATION_NOTIFIER > >> > >> The task mi

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Paolo Bonzini
>> From 4eb9d7132e1990c0586f28af3103675416d38974 Mon Sep 17 00:00:00 2001 >> From: Paolo Bonzini >> Date: Fri, 17 Apr 2015 14:57:34 +0200 >> Subject: [PATCH] sched: add CONFIG_TASK_MIGRATION_NOTIFIER >> >> The task migration notifier is only used in x86 paravirt. Make it >> possible to compile

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Andy Lutomirski
On Fri, Apr 17, 2015 at 12:01 PM, Marcelo Tosatti wrote: > On Fri, Apr 17, 2015 at 03:38:58PM +0200, Paolo Bonzini wrote: >> On 17/04/2015 15:10, Peter Zijlstra wrote: >> > On Fri, Apr 17, 2015 at 02:46:57PM +0200, Paolo Bonzini wrote: >> >> On 17/04/2015 12:55, Peter Zijlstra wrote: >> >>> Also,

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Marcelo Tosatti
On Fri, Apr 17, 2015 at 03:38:58PM +0200, Paolo Bonzini wrote: > On 17/04/2015 15:10, Peter Zijlstra wrote: > > On Fri, Apr 17, 2015 at 02:46:57PM +0200, Paolo Bonzini wrote: > >> On 17/04/2015 12:55, Peter Zijlstra wrote: > >>> Also, it looks like you already do exactly this for other things, look

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Paolo Bonzini
On 17/04/2015 15:43, Peter Zijlstra wrote: > On Fri, Apr 17, 2015 at 03:38:58PM +0200, Paolo Bonzini wrote: >>> The path this notifier is called from has nothing to do with those >>> costs. > > Its attributed to the entity doing the migration, which can be the > wakeup path or a softirq. And we v

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 03:38:58PM +0200, Paolo Bonzini wrote: > > The path this notifier is called from has nothing to do with those > > costs. > > How not? The task is going to incur those costs, it's not like half > a dozen extra instruction make any difference. But anyway... Its attributed

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Paolo Bonzini
On 17/04/2015 15:10, Peter Zijlstra wrote: > On Fri, Apr 17, 2015 at 02:46:57PM +0200, Paolo Bonzini wrote: >> On 17/04/2015 12:55, Peter Zijlstra wrote: >>> Also, it looks like you already do exactly this for other things, look >>> at: >>> >>> kvm_sched_in() >>> kvm_arch_vcpu_load() >>>

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 02:46:57PM +0200, Paolo Bonzini wrote: > On 17/04/2015 12:55, Peter Zijlstra wrote: > > Also, it looks like you already do exactly this for other things, look > > at: > > > > kvm_sched_in() > > kvm_arch_vcpu_load() > > if (unlikely(vcpu->cpu != cpu) ... )

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Paolo Bonzini
On 17/04/2015 12:55, Peter Zijlstra wrote: > Also, it looks like you already do exactly this for other things, look > at: > > kvm_sched_in() > kvm_arch_vcpu_load() > if (unlikely(vcpu->cpu != cpu) ... ) > > So no, I don't believe for one second you need this. You're mis

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 12:38:07PM +0200, Paolo Bonzini wrote: > > > On 17/04/2015 12:36, Peter Zijlstra wrote: > > Now you make everybody pay for your crap, x86-64 paravirt or not. Keep > > the cost by those who need it. > > > > Please take it out, ASAP. > > I'll just implement the static key.

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Paolo Bonzini
On 17/04/2015 12:36, Peter Zijlstra wrote: > Now you make everybody pay for your crap, x86-64 paravirt or not. Keep > the cost by those who need it. > > Please take it out, ASAP. I'll just implement the static key. Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 12:09:49PM +0200, Paolo Bonzini wrote: > > > On 17/04/2015 11:17, Peter Zijlstra wrote: > > On Fri, Apr 17, 2015 at 10:52:38AM +0200, Peter Zijlstra wrote: > >> On Fri, Apr 10, 2015 at 05:01:29PM +0200, Paolo Bonzini wrote: > >>> include/linux/sched.h

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Paolo Bonzini
On 17/04/2015 11:17, Peter Zijlstra wrote: > On Fri, Apr 17, 2015 at 10:52:38AM +0200, Peter Zijlstra wrote: >> On Fri, Apr 10, 2015 at 05:01:29PM +0200, Paolo Bonzini wrote: >>> include/linux/sched.h |8 + >>> kernel/sched/core.c|

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 10:52:38AM +0200, Peter Zijlstra wrote: > On Fri, Apr 10, 2015 at 05:01:29PM +0200, Paolo Bonzini wrote: > > include/linux/sched.h |8 + > > kernel/sched/core.c| 15 + > > Can you please not puke over the sc

Re: [GIT PULL] First batch of KVM changes for 4.1

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 10, 2015 at 05:01:29PM +0200, Paolo Bonzini wrote: > include/linux/sched.h |8 + > kernel/sched/core.c| 15 + Can you please not puke over the scheduler without Acks from at least one maintainer? I complained about thi