All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-16  7:11 ` Paul Mackerras
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-16  7:11 UTC (permalink / raw)
  To: kvm, kvm-ppc; +Cc: Alexander Graf, david, lvivier

This series contains two fixes for the new dynamic micro-threading
code that was added recently for HV-mode KVM on Power servers.
The patches are against Alex Graf's kvm-ppc-queue branch.  Please
apply.

Paul.

 arch/powerpc/kvm/book3s_hv.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-16  7:11 ` Paul Mackerras
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-16  7:11 UTC (permalink / raw)
  To: kvm, kvm-ppc; +Cc: Alexander Graf, david, lvivier

This series contains two fixes for the new dynamic micro-threading
code that was added recently for HV-mode KVM on Power servers.
The patches are against Alex Graf's kvm-ppc-queue branch.  Please
apply.

Paul.

 arch/powerpc/kvm/book3s_hv.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/2] KVM: PPC: Book3S HV: Fix preempted vcore list locking
  2015-07-16  7:11 ` Paul Mackerras
@ 2015-07-16  7:11   ` Paul Mackerras
  -1 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-16  7:11 UTC (permalink / raw)
  To: kvm, kvm-ppc; +Cc: Alexander Graf, david, lvivier

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>
---
 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);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 1/2] KVM: PPC: Book3S HV: Fix preempted vcore list locking
@ 2015-07-16  7:11   ` Paul Mackerras
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-16  7:11 UTC (permalink / raw)
  To: kvm, kvm-ppc; +Cc: Alexander Graf, david, lvivier

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>
---
 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);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation
  2015-07-16  7:11 ` Paul Mackerras
@ 2015-07-16  7:11   ` Paul Mackerras
  -1 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-16  7:11 UTC (permalink / raw)
  To: kvm, kvm-ppc; +Cc: Alexander Graf, david, lvivier

Whenever a vcore state is VCORE_PREEMPT we need to be counting stolen
time for it.  This currently isn't the case when we have a vcore that
no longer has any runnable threads in it but still has a runner task,
so we do an explicit call to kvmppc_core_start_stolen() in that case.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/kvm/book3s_hv.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3d02276..fad52f2 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -2283,9 +2283,14 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master)
 	}
 	list_del_init(&vc->preempt_list);
 	if (!is_master) {
-		vc->vcore_state = vc->runner ? VCORE_PREEMPT : VCORE_INACTIVE;
-		if (still_running > 0)
+		if (still_running > 0) {
 			kvmppc_vcore_preempt(vc);
+		} else if (vc->runner) {
+			vc->vcore_state = VCORE_PREEMPT;
+			kvmppc_core_start_stolen(vc);
+		} else {
+			vc->vcore_state = VCORE_INACTIVE;
+		}
 		if (vc->n_runnable > 0 && vc->runner == NULL) {
 			/* make sure there's a candidate runner awake */
 			vcpu = list_first_entry(&vc->runnable_threads,
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/2] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation
@ 2015-07-16  7:11   ` Paul Mackerras
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-16  7:11 UTC (permalink / raw)
  To: kvm, kvm-ppc; +Cc: Alexander Graf, david, lvivier

Whenever a vcore state is VCORE_PREEMPT we need to be counting stolen
time for it.  This currently isn't the case when we have a vcore that
no longer has any runnable threads in it but still has a runner task,
so we do an explicit call to kvmppc_core_start_stolen() in that case.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/kvm/book3s_hv.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 3d02276..fad52f2 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -2283,9 +2283,14 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master)
 	}
 	list_del_init(&vc->preempt_list);
 	if (!is_master) {
-		vc->vcore_state = vc->runner ? VCORE_PREEMPT : VCORE_INACTIVE;
-		if (still_running > 0)
+		if (still_running > 0) {
 			kvmppc_vcore_preempt(vc);
+		} else if (vc->runner) {
+			vc->vcore_state = VCORE_PREEMPT;
+			kvmppc_core_start_stolen(vc);
+		} else {
+			vc->vcore_state = VCORE_INACTIVE;
+		}
 		if (vc->n_runnable > 0 && vc->runner = NULL) {
 			/* make sure there's a candidate runner awake */
 			vcpu = list_first_entry(&vc->runnable_threads,
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
  2015-07-16  7:11 ` Paul Mackerras
@ 2015-07-16 14:06   ` Laurent Vivier
  -1 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2015-07-16 14:06 UTC (permalink / raw)
  To: Paul Mackerras, kvm, kvm-ppc; +Cc: Alexander Graf, david



On 16/07/2015 09:11, Paul Mackerras wrote:
> This series contains two fixes for the new dynamic micro-threading
> code that was added recently for HV-mode KVM on Power servers.
> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
> apply.
> 
> Paul.
> 
>  arch/powerpc/kvm/book3s_hv.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)

Tested-by: Laurent Vivier <lvivier@redhat.com>

[this series has corrected a host kernel crash when CPU are overcommitted]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-16 14:06   ` Laurent Vivier
  0 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2015-07-16 14:06 UTC (permalink / raw)
  To: Paul Mackerras, kvm, kvm-ppc; +Cc: Alexander Graf, david



On 16/07/2015 09:11, Paul Mackerras wrote:
> This series contains two fixes for the new dynamic micro-threading
> code that was added recently for HV-mode KVM on Power servers.
> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
> apply.
> 
> Paul.
> 
>  arch/powerpc/kvm/book3s_hv.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)

Tested-by: Laurent Vivier <lvivier@redhat.com>

[this series has corrected a host kernel crash when CPU are overcommitted]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
  2015-07-16  7:11 ` Paul Mackerras
@ 2015-07-20  6:49   ` David Gibson
  -1 siblings, 0 replies; 16+ messages in thread
From: David Gibson @ 2015-07-20  6:49 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: kvm, kvm-ppc, Alexander Graf, lvivier

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote:
> This series contains two fixes for the new dynamic micro-threading
> code that was added recently for HV-mode KVM on Power servers.
> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
> apply.

agraf,

Any word on these?  These appear to fix a really nasty host crash in
current upstream.  I'd really like to see them merged ASAP.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-20  6:49   ` David Gibson
  0 siblings, 0 replies; 16+ messages in thread
From: David Gibson @ 2015-07-20  6:49 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: kvm, kvm-ppc, Alexander Graf, lvivier

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote:
> This series contains two fixes for the new dynamic micro-threading
> code that was added recently for HV-mode KVM on Power servers.
> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
> apply.

agraf,

Any word on these?  These appear to fix a really nasty host crash in
current upstream.  I'd really like to see them merged ASAP.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
  2015-07-20  6:49   ` David Gibson
@ 2015-07-23 12:02     ` Alexander Graf
  -1 siblings, 0 replies; 16+ messages in thread
From: Alexander Graf @ 2015-07-23 12:02 UTC (permalink / raw)
  To: David Gibson, Paul Mackerras; +Cc: kvm, kvm-ppc, lvivier



On 20.07.15 08:49, David Gibson wrote:
> On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote:
>> This series contains two fixes for the new dynamic micro-threading
>> code that was added recently for HV-mode KVM on Power servers.
>> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
>> apply.
> 
> agraf,
> 
> Any word on these?  These appear to fix a really nasty host crash in
> current upstream.  I'd really like to see them merged ASAP.

Thanks, applied to kvm-ppc-queue.

The host crash should only occur with dynamic micro-threading enabled,
which is not in Linus' tree, correct?


Alex


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-23 12:02     ` Alexander Graf
  0 siblings, 0 replies; 16+ messages in thread
From: Alexander Graf @ 2015-07-23 12:02 UTC (permalink / raw)
  To: David Gibson, Paul Mackerras; +Cc: kvm, kvm-ppc, lvivier



On 20.07.15 08:49, David Gibson wrote:
> On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote:
>> This series contains two fixes for the new dynamic micro-threading
>> code that was added recently for HV-mode KVM on Power servers.
>> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
>> apply.
> 
> agraf,
> 
> Any word on these?  These appear to fix a really nasty host crash in
> current upstream.  I'd really like to see them merged ASAP.

Thanks, applied to kvm-ppc-queue.

The host crash should only occur with dynamic micro-threading enabled,
which is not in Linus' tree, correct?


Alex


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
  2015-07-23 12:02     ` Alexander Graf
@ 2015-07-24 11:45       ` Laurent Vivier
  -1 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2015-07-24 11:45 UTC (permalink / raw)
  To: Alexander Graf, David Gibson, Paul Mackerras; +Cc: kvm, kvm-ppc



On 23/07/2015 14:02, Alexander Graf wrote:
> 
> 
> On 20.07.15 08:49, David Gibson wrote:
>> On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote:
>>> This series contains two fixes for the new dynamic micro-threading
>>> code that was added recently for HV-mode KVM on Power servers.
>>> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
>>> apply.
>>
>> agraf,
>>
>> Any word on these?  These appear to fix a really nasty host crash in
>> current upstream.  I'd really like to see them merged ASAP.
> 
> Thanks, applied to kvm-ppc-queue.
> 
> The host crash should only occur with dynamic micro-threading enabled,
> which is not in Linus' tree, correct?

Yes, it only occurs with dynamic micro-threading enabled.
Yes, this is not in Linus' tree.

Laurent

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-24 11:45       ` Laurent Vivier
  0 siblings, 0 replies; 16+ messages in thread
From: Laurent Vivier @ 2015-07-24 11:45 UTC (permalink / raw)
  To: Alexander Graf, David Gibson, Paul Mackerras; +Cc: kvm, kvm-ppc



On 23/07/2015 14:02, Alexander Graf wrote:
> 
> 
> On 20.07.15 08:49, David Gibson wrote:
>> On Thu, Jul 16, 2015 at 05:11:12PM +1000, Paul Mackerras wrote:
>>> This series contains two fixes for the new dynamic micro-threading
>>> code that was added recently for HV-mode KVM on Power servers.
>>> The patches are against Alex Graf's kvm-ppc-queue branch.  Please
>>> apply.
>>
>> agraf,
>>
>> Any word on these?  These appear to fix a really nasty host crash in
>> current upstream.  I'd really like to see them merged ASAP.
> 
> Thanks, applied to kvm-ppc-queue.
> 
> The host crash should only occur with dynamic micro-threading enabled,
> which is not in Linus' tree, correct?

Yes, it only occurs with dynamic micro-threading enabled.
Yes, this is not in Linus' tree.

Laurent

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
  2015-07-23 12:02     ` Alexander Graf
@ 2015-07-24 11:45       ` Paul Mackerras
  -1 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-24 11:45 UTC (permalink / raw)
  To: Alexander Graf; +Cc: David Gibson, kvm, kvm-ppc, lvivier

On Thu, Jul 23, 2015 at 02:02:51PM +0200, Alexander Graf wrote:
> 
> The host crash should only occur with dynamic micro-threading enabled,
> which is not in Linus' tree, correct?

Correct.

Paul.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/2] Two fixes for dynamic micro-threading
@ 2015-07-24 11:45       ` Paul Mackerras
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Mackerras @ 2015-07-24 11:45 UTC (permalink / raw)
  To: Alexander Graf; +Cc: David Gibson, kvm, kvm-ppc, lvivier

On Thu, Jul 23, 2015 at 02:02:51PM +0200, Alexander Graf wrote:
> 
> The host crash should only occur with dynamic micro-threading enabled,
> which is not in Linus' tree, correct?

Correct.

Paul.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-07-24 11:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-16  7:11 [PATCH 0/2] Two fixes for dynamic micro-threading Paul Mackerras
2015-07-16  7:11 ` Paul Mackerras
2015-07-16  7:11 ` [PATCH 1/2] KVM: PPC: Book3S HV: Fix preempted vcore list locking Paul Mackerras
2015-07-16  7:11   ` Paul Mackerras
2015-07-16  7:11 ` [PATCH 2/2] KVM: PPC: Book3S HV: Fix preempted vcore stolen time calculation Paul Mackerras
2015-07-16  7:11   ` Paul Mackerras
2015-07-16 14:06 ` [PATCH 0/2] Two fixes for dynamic micro-threading Laurent Vivier
2015-07-16 14:06   ` Laurent Vivier
2015-07-20  6:49 ` David Gibson
2015-07-20  6:49   ` David Gibson
2015-07-23 12:02   ` Alexander Graf
2015-07-23 12:02     ` Alexander Graf
2015-07-24 11:45     ` Laurent Vivier
2015-07-24 11:45       ` Laurent Vivier
2015-07-24 11:45     ` Paul Mackerras
2015-07-24 11:45       ` Paul Mackerras

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.