[patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-14 Thread Marcelo Tosatti
The problem: On -RT, an emulated LAPIC timer instances has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu thread is scheduled This extra context switch introduces unnecessary latency in the LAPIC path for a KVM guest. The solution: Al

[patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-21 Thread Marcelo Tosatti
The problem: On -RT, an emulated LAPIC timer instances has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu thread is scheduled This extra context switch introduces unnecessary latency in the LAPIC path for a KVM guest. The solution: Al

[patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-04-08 Thread Marcelo Tosatti
The problem: On -RT, an emulated LAPIC timer instances has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu thread is scheduled This extra context switch introduces unnecessary latency in the LAPIC path for a KVM guest. The solution: Al

[patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2014-11-25 Thread Marcelo Tosatti
The problem: On -RT, an emulated LAPIC timer instances has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu thread is scheduled This extra context switch introduces unnecessary latency in the LAPIC path for a KVM guest. The solution: Al

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-08-07 Thread Peter Zijlstra
On Wed, Feb 25, 2015 at 10:02:50PM +0100, Sebastian Andrzej Siewior wrote: > >+static inline int swait_active(struct swait_queue_head *q) > >+{ > >+return !list_empty(&q->task_list); > > In RT there was a smp_mb() which you dropped and I assume you had > reasons for it. Yeah, RT didn't have

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-08-07 Thread Peter Zijlstra
On Fri, Aug 07, 2015 at 12:57:38PM +0200, Peter Zijlstra wrote: > > >+void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait) > > this one has no users the __ suggests that it is locked edition. Maybe > > it is for the completions… > > Yeah, who knows, I certainly do not anymor

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-08-07 Thread Christoph Hellwig
On Fri, Aug 07, 2015 at 01:14:15PM +0200, Peter Zijlstra wrote: > On that, we cannot convert completions to swait. Because swait wake_all > must not happen from IRQ context, and complete_all() typically is used > from just that. If swait queues aren't useable from IRQ context they will be fairly u

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-08-07 Thread Peter Zijlstra
On Fri, Aug 07, 2015 at 09:41:31AM -0700, Christoph Hellwig wrote: > On Fri, Aug 07, 2015 at 01:14:15PM +0200, Peter Zijlstra wrote: > > On that, we cannot convert completions to swait. Because swait wake_all > > must not happen from IRQ context, and complete_all() typically is used > > from just t

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-08-08 Thread Christoph Hellwig
On Fri, Aug 07, 2015 at 06:45:26PM +0200, Peter Zijlstra wrote: > Its just the swait_wake_all() that is not. The entire purpose of them > was to have something that allows bounded execution (RT and all). Still not sure i that might be a too big burden for mainline, but at least it's not as severe.

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-08-17 Thread Thomas Gleixner
On Fri, 7 Aug 2015, Peter Zijlstra wrote: > On Fri, Aug 07, 2015 at 12:57:38PM +0200, Peter Zijlstra wrote: > > > > >+void __finish_swait(struct swait_queue_head *q, struct swait_queue > > > >*wait) > > > > this one has no users the __ suggests that it is locked edition. Maybe > > > it is for th

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-14 Thread Rik van Riel
On 01/14/2015 12:12 PM, Marcelo Tosatti wrote: > The problem: > > On -RT, an emulated LAPIC timer instances has the following path: > > 1) hard interrupt > 2) ksoftirqd is scheduled > 3) ksoftirqd wakes up vcpu thread > 4) vcpu thread is scheduled > > This extra context switch introduces unneces

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-16 Thread Steven Rostedt
On Fri, 16 Jan 2015 11:48:46 -0500 Steven Rostedt wrote: > > static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) > > { > > - DEFINE_WAIT(wait); > > + DEFINE_SWAITER(wait); > > > > - prepare_to_wait(&vc->wq, &wait, TASK_INTERRUPTIBLE); > > + swait_prepare(&vc->wq, &wait, TASK_INT

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-16 Thread Steven Rostedt
On Fri, 16 Jan 2015 11:40:45 -0500 Marcelo Tosatti wrote: > The problem: > > On -RT, an emulated LAPIC timer instances has the following path: > > 1) hard interrupt > 2) ksoftirqd is scheduled > 3) ksoftirqd wakes up vcpu thread > 4) vcpu thread is scheduled > > This extra context switch intro

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-16 Thread Peter Zijlstra
On Fri, Jan 16, 2015 at 11:48:46AM -0500, Steven Rostedt wrote: > I notice everywhere you have a swait_wake_interruptible() but here. Is > there a reason why? > > IIRC, Peter wants to make swait wakeup usage homogenous. That is, you > either sleep in an interruptible state, or you don't. You can't

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-19 Thread Marcelo Tosatti
On Fri, Jan 16, 2015 at 11:48:46AM -0500, Steven Rostedt wrote: > > @@ -971,8 +971,8 @@ > > kvm_mips_callbacks->queue_timer_int(vcpu); > > > > vcpu->arch.wait = 0; > > - if (waitqueue_active(&vcpu->wq)) { > > - wake_up_interruptible(&vcpu->wq); > > + if (swaitqueue_active(&v

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-19 Thread Paul Mackerras
On Mon, Jan 19, 2015 at 12:41:00PM -0200, Marcelo Tosatti wrote: > On Fri, Jan 16, 2015 at 11:48:46AM -0500, Steven Rostedt wrote: > > > static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) > > > { > > > - DEFINE_WAIT(wait); > > > + DEFINE_SWAITER(wait); > > > > > > - prepare_to_wait(&vc->

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-20 Thread Steven Rostedt
On Tue, 20 Jan 2015 16:46:53 +1100 Paul Mackerras wrote: > On Mon, Jan 19, 2015 at 12:41:00PM -0200, Marcelo Tosatti wrote: > > On Fri, Jan 16, 2015 at 11:48:46AM -0500, Steven Rostedt wrote: > > > > static void kvmppc_vcore_blocked(struct kvmppc_vcore *vc) > > > > { > > > > - DEFINE_WAIT

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-01-21 Thread Peter Zijlstra
On Tue, Jan 20, 2015 at 01:16:13PM -0500, Steven Rostedt wrote: > I'm actually wondering if we should just nuke the _interruptible() > version of swait. As it should only be all interruptible or all not > interruptible, that the swait_wake() should just do the wake up > regardless. In which case, s

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-02-17 Thread Sebastian Andrzej Siewior
* Peter Zijlstra | 2015-01-21 16:07:16 [+0100]: >On Tue, Jan 20, 2015 at 01:16:13PM -0500, Steven Rostedt wrote: >> I'm actually wondering if we should just nuke the _interruptible() >> version of swait. As it should only be all interruptible or all not >> interruptible, that the swait_wake() shou

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-02-18 Thread Peter Zijlstra
On Tue, Feb 17, 2015 at 06:44:19PM +0100, Sebastian Andrzej Siewior wrote: > * Peter Zijlstra | 2015-01-21 16:07:16 [+0100]: > > >On Tue, Jan 20, 2015 at 01:16:13PM -0500, Steven Rostedt wrote: > >> I'm actually wondering if we should just nuke the _interruptible() > >> version of swait. As it sho

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-02-25 Thread Sebastian Andrzej Siewior
* Peter Zijlstra | 2015-02-18 15:03:20 [+0100]: >On Tue, Feb 17, 2015 at 06:44:19PM +0100, Sebastian Andrzej Siewior wrote: >> * Peter Zijlstra | 2015-01-21 16:07:16 [+0100]: >> >> >On Tue, Jan 20, 2015 at 01:16:13PM -0500, Steven Rostedt wrote: >> >> I'm actually wondering if we should just nuke

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-02-26 Thread Marcelo Tosatti
On Tue, Feb 17, 2015 at 06:44:19PM +0100, Sebastian Andrzej Siewior wrote: > * Peter Zijlstra | 2015-01-21 16:07:16 [+0100]: > > >On Tue, Jan 20, 2015 at 01:16:13PM -0500, Steven Rostedt wrote: > >> I'm actually wondering if we should just nuke the _interruptible() > >> version of swait. As it sho

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-03-04 Thread Marcelo Tosatti
On Thu, Feb 26, 2015 at 09:23:57PM -0300, Marcelo Tosatti wrote: > On Tue, Feb 17, 2015 at 06:44:19PM +0100, Sebastian Andrzej Siewior wrote: > > * Peter Zijlstra | 2015-01-21 16:07:16 [+0100]: > > > > >On Tue, Jan 20, 2015 at 01:16:13PM -0500, Steven Rostedt wrote: > > >> I'm actually wondering i

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-03-04 Thread Sebastian Andrzej Siewior
On 03/05/2015 02:09 AM, Marcelo Tosatti wrote: >> Can you please include the series? >> >> Thanks > > Sebastian? I will pick it up, don't worry. I think I do my -RT day tomorrow. Sebastian -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vge

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2015-03-06 Thread Sebastian Andrzej Siewior
* Marcelo Tosatti | 2015-01-14 15:12:52 [-0200]: Against which tree was this prepared? Could please rebase it against v3.18.7-rt2? Because a I see "fuzz 2", the mips file is gone and s390 rejects almost every chunk. And there was that mips chunk Steven noticed. Patch #2 seems to apply but since it

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2014-11-25 Thread Rik van Riel
On 11/25/2014 12:21 PM, Marcelo Tosatti wrote: > The problem: > > On -RT, an emulated LAPIC timer instances has the following path: > > 1) hard interrupt > 2) ksoftirqd is scheduled > 3) ksoftirqd wakes up vcpu thread > 4) vcpu thread is scheduled > > This extra context switch introduces unneces

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2014-11-25 Thread Rik van Riel
On 11/25/2014 01:57 PM, Rik van Riel wrote: > On 11/25/2014 12:21 PM, Marcelo Tosatti wrote: >> The problem: >> >> On -RT, an emulated LAPIC timer instances has the following path: >> >> 1) hard interrupt >> 2) ksoftirqd is scheduled >> 3) ksoftirqd wakes up vcpu thread >> 4) vcpu thread is schedul

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2014-11-25 Thread Marcelo Tosatti
On Tue, Nov 25, 2014 at 01:57:37PM -0500, Rik van Riel wrote: > On 11/25/2014 12:21 PM, Marcelo Tosatti wrote: > > The problem: > > > > On -RT, an emulated LAPIC timer instances has the following path: > > > > 1) hard interrupt > > 2) ksoftirqd is scheduled > > 3) ksoftirqd wakes up vcpu thread >

Re: [patch -rt 1/2] KVM: use simple waitqueue for vcpu->wq

2014-11-25 Thread Thomas Gleixner
On Tue, 25 Nov 2014, Rik van Riel wrote: > On 11/25/2014 12:21 PM, Marcelo Tosatti wrote: > > The problem: > > > > On -RT, an emulated LAPIC timer instances has the following path: > > > > 1) hard interrupt > > 2) ksoftirqd is scheduled > > 3) ksoftirqd wakes up vcpu thread > > 4) vcpu thread is