Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1176683
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage |
| Date | 2015-07-03 17:50 +0200 |
| Message-ID | <pIbnX-1T7-17@gated-at.bofh.it> (permalink) |
| References | (6 earlier) <pI92O-xt-15@gated-at.bofh.it> <pIaUW-1GA-15@gated-at.bofh.it> <pIb4D-1JT-29@gated-at.bofh.it> <pIbei-1No-29@gated-at.bofh.it> <pIbnX-1T7-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 03/07/2015 17:42, Peter Zijlstra wrote:
> On Fri, Jul 03, 2015 at 05:38:42PM +0200, Paolo Bonzini wrote:
>> So basically this. Can you reply with SoB and maybe Acked-by?
>
> Ah, thanks for doing that!
>
>> ------------- 8< ---------------
>> From: Peter Zijlstra <peterz@infradead.org>
>> Subject: [PATCH] sched, preempt_notifier: separate notifier registration from static_key inc/dec
>>
>> Commit 1cde2930e154 ("sched/preempt: Add static_key() to preempt_notifiers")
>> had two problems. First, the preempt-notifier API needs to sleep with the
>> addition of the static_key, we do however need to hold off preemption
>> while modifying the preempt notifier list, otherwise a preemption could
>> observe an inconsistent list state. KVM correctly registers and
>> unregisters preempt notifiers with preemption disabled, so the sleep
>> caused dmesg splats.
>>
>> Second, KVM registers and unregisters preemption notifiers very often
>> (in vcpu_load/vcpu_put). With a single uniprocessor guest the static key
>> would move between 0 and 1 continuously, hitting the slow path on every
>> userspace exit.
>>
>> To fix this, wrap the static_key inc/dec in a new API, and call it from
>> KVM.
>>
>> Fixes: 1cde2930e154 ("sched/preempt: Add static_key() to preempt_notifiers")
>> Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
>> Reported-by: Takashi Iwai <tiwai@suse.de>
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Ok, I'm crossing fingers and including this in my pull request in order
to preserve bisectability. Thanks.
Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Peter Zijlstra <peterz@infradead.org> - 2015-07-03 15:20 +0200
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Peter Zijlstra <peterz@infradead.org> - 2015-07-03 17:20 +0200
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Paolo Bonzini <pbonzini@redhat.com> - 2015-07-03 17:30 +0200
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Paolo Bonzini <pbonzini@redhat.com> - 2015-07-03 17:40 +0200
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Peter Zijlstra <peterz@infradead.org> - 2015-07-03 17:50 +0200
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Paolo Bonzini <pbonzini@redhat.com> - 2015-07-03 17:50 +0200
Re: [PATCH] sched,kvm: Fix KVM preempt_notifier usage Takashi Iwai <tiwai@suse.de> - 2015-07-03 18:00 +0200
csiph-web