From: Alexander Graf <agraf@suse.de> To: kvm-ppc <kvm-ppc@vger.kernel.org> Cc: KVM <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, Paul Mackerras <paulus@samba.org> Subject: [PULL 10/12] KVM: PPC: Book3S HV: Fix preempted vcore list locking Date: Sat, 22 Aug 2015 11:21:33 +0200 [thread overview] Message-ID: <1440235295-244203-11-git-send-email-agraf@suse.de> (raw) In-Reply-To: <1440235295-244203-1-git-send-email-agraf@suse.de> From: Paul Mackerras <paulus@samba.org> When a vcore gets preempted, we put it on the preempted vcore list for the current CPU. The runner task then calls schedule() and comes back some time later and takes itself off the list. We need to be careful to lock the list that it was put onto, which may not be the list for the current CPU since the runner task may have moved to another CPU. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de> --- arch/powerpc/kvm/book3s_hv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 6e3ef30..3d02276 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -1962,10 +1962,11 @@ static void kvmppc_vcore_preempt(struct kvmppc_vcore *vc) static void kvmppc_vcore_end_preempt(struct kvmppc_vcore *vc) { - struct preempted_vcore_list *lp = this_cpu_ptr(&preempted_vcores); + struct preempted_vcore_list *lp; kvmppc_core_end_stolen(vc); if (!list_empty(&vc->preempt_list)) { + lp = &per_cpu(preempted_vcores, vc->pcpu); spin_lock(&lp->lock); list_del_init(&vc->preempt_list); spin_unlock(&lp->lock); -- 1.8.1.4
WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de> To: kvm-ppc <kvm-ppc@vger.kernel.org> Cc: KVM <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>, Paul Mackerras <paulus@samba.org> Subject: [PULL 10/12] KVM: PPC: Book3S HV: Fix preempted vcore list locking Date: Sat, 22 Aug 2015 09:21:33 +0000 [thread overview] Message-ID: <1440235295-244203-11-git-send-email-agraf@suse.de> (raw) In-Reply-To: <1440235295-244203-1-git-send-email-agraf@suse.de> From: Paul Mackerras <paulus@samba.org> When a vcore gets preempted, we put it on the preempted vcore list for the current CPU. The runner task then calls schedule() and comes back some time later and takes itself off the list. We need to be careful to lock the list that it was put onto, which may not be the list for the current CPU since the runner task may have moved to another CPU. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de> --- arch/powerpc/kvm/book3s_hv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 6e3ef30..3d02276 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -1962,10 +1962,11 @@ static void kvmppc_vcore_preempt(struct kvmppc_vcore *vc) static void kvmppc_vcore_end_preempt(struct kvmppc_vcore *vc) { - struct preempted_vcore_list *lp = this_cpu_ptr(&preempted_vcores); + struct preempted_vcore_list *lp; kvmppc_core_end_stolen(vc); if (!list_empty(&vc->preempt_list)) { + lp = &per_cpu(preempted_vcores, vc->pcpu); spin_lock(&lp->lock); list_del_init(&vc->preempt_list); spin_unlock(&lp->lock); -- 1.8.1.4
next prev parent reply other threads:[~2015-08-22 9:21 UTC|newest] Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-08-22 9:21 [PULL 00/12] ppc patch queue 2015-08-22 Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 01/12] KVM: PPC: fix suspicious use of conditional operator Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 02/12] KVM: PPC: Remove PPC970 from KVM_BOOK3S_64_HV text in Kconfig Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 03/12] KVM: PPC: Fix warnings from sparse Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 04/12] KVM: PPC: add missing pt_regs initialization Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 05/12] KVM: PPC: Book3S HV: Make use of unused threads when running guests Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 06/12] KVM: PPC: Book3S HV: Implement dynamic micro-threading on POWER8 Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 07/12] KVM: PPC: Book3S HV: Fix race in reading change bit when removing HPTE Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 08/12] KVM: PPC: Book3S HV: Fix bug in dirty page tracking Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 09/12] KVM: PPC: Book3S HV: Implement H_CLEAR_REF and H_CLEAR_MOD Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` Alexander Graf [this message] 2015-08-22 9:21 ` [PULL 10/12] KVM: PPC: Book3S HV: Fix preempted vcore list locking Alexander Graf 2015-08-22 9:21 ` [PULL 11/12] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 9:21 ` [PULL 12/12] KVM: PPC: Book3S: correct width in XER handling Alexander Graf 2015-08-22 9:21 ` Alexander Graf 2015-08-22 22:32 ` [PULL 00/12] ppc patch queue 2015-08-22 Paolo Bonzini 2015-08-22 22:32 ` Paolo Bonzini 2015-08-24 4:49 ` Alexander Graf 2015-08-24 4:49 ` Alexander Graf 2015-08-24 8:52 ` Paolo Bonzini 2015-08-24 8:52 ` Paolo Bonzini
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1440235295-244203-11-git-send-email-agraf@suse.de \ --to=agraf@suse.de \ --cc=kvm-ppc@vger.kernel.org \ --cc=kvm@vger.kernel.org \ --cc=paulus@samba.org \ --cc=pbonzini@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.