All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perfc: count number of explicit vcpu yields
@ 2015-11-09 14:00 Ian Campbell
  2015-11-09 14:09 ` Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ian Campbell @ 2015-11-09 14:00 UTC (permalink / raw)
  To: xen-devel; +Cc: Dario Faggioli, george.dunlap, jbeulich, Ian Campbell

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/schedule.c        | 1 +
 xen/include/xen/perfc_defn.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 292e9a0..86d6cc0 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -896,6 +896,7 @@ long vcpu_yield(void)
     struct vcpu * v=current;
     spinlock_t *lock = vcpu_schedule_lock_irq(v);
 
+    SCHED_STAT_CRANK(sched_yield);
     SCHED_OP(VCPU2OP(v), yield, v);
     vcpu_schedule_unlock_irq(lock, v);
 
diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
index 76ee803..034c7d3 100644
--- a/xen/include/xen/perfc_defn.h
+++ b/xen/include/xen/perfc_defn.h
@@ -16,6 +16,7 @@ PERFCOUNTER(ipis,                   "#IPIs")
 PERFCOUNTER(sched_irq,              "sched: timer")
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
+PERFCOUNTER(sched_yield,            "sched: vcpu yield")
 PERFCOUNTER(schedule,               "sched: specific scheduler")
 PERFCOUNTER(dom_init,               "sched: dom_init")
 PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
-- 
2.1.4

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 14:00 [PATCH] perfc: count number of explicit vcpu yields Ian Campbell
@ 2015-11-09 14:09 ` Jan Beulich
  2015-11-09 14:14 ` George Dunlap
  2015-11-09 14:53 ` Dario Faggioli
  2 siblings, 0 replies; 9+ messages in thread
From: Jan Beulich @ 2015-11-09 14:09 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Dario Faggioli, george.dunlap, xen-devel

>>> On 09.11.15 at 15:00, <ian.campbell@citrix.com> wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 14:00 [PATCH] perfc: count number of explicit vcpu yields Ian Campbell
  2015-11-09 14:09 ` Jan Beulich
@ 2015-11-09 14:14 ` George Dunlap
  2015-11-09 14:53 ` Dario Faggioli
  2 siblings, 0 replies; 9+ messages in thread
From: George Dunlap @ 2015-11-09 14:14 UTC (permalink / raw)
  To: Ian Campbell, xen-devel; +Cc: Dario Faggioli, jbeulich

On 09/11/15 14:00, Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

> ---
>  xen/common/schedule.c        | 1 +
>  xen/include/xen/perfc_defn.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/xen/common/schedule.c b/xen/common/schedule.c
> index 292e9a0..86d6cc0 100644
> --- a/xen/common/schedule.c
> +++ b/xen/common/schedule.c
> @@ -896,6 +896,7 @@ long vcpu_yield(void)
>      struct vcpu * v=current;
>      spinlock_t *lock = vcpu_schedule_lock_irq(v);
>  
> +    SCHED_STAT_CRANK(sched_yield);
>      SCHED_OP(VCPU2OP(v), yield, v);
>      vcpu_schedule_unlock_irq(lock, v);
>  
> diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h
> index 76ee803..034c7d3 100644
> --- a/xen/include/xen/perfc_defn.h
> +++ b/xen/include/xen/perfc_defn.h
> @@ -16,6 +16,7 @@ PERFCOUNTER(ipis,                   "#IPIs")
>  PERFCOUNTER(sched_irq,              "sched: timer")
>  PERFCOUNTER(sched_run,              "sched: runs through scheduler")
>  PERFCOUNTER(sched_ctx,              "sched: context switches")
> +PERFCOUNTER(sched_yield,            "sched: vcpu yield")
>  PERFCOUNTER(schedule,               "sched: specific scheduler")
>  PERFCOUNTER(dom_init,               "sched: dom_init")
>  PERFCOUNTER(dom_destroy,            "sched: dom_destroy")
> 

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 14:00 [PATCH] perfc: count number of explicit vcpu yields Ian Campbell
  2015-11-09 14:09 ` Jan Beulich
  2015-11-09 14:14 ` George Dunlap
@ 2015-11-09 14:53 ` Dario Faggioli
  2015-11-09 15:02   ` Boris Ostrovsky
  2 siblings, 1 reply; 9+ messages in thread
From: Dario Faggioli @ 2015-11-09 14:53 UTC (permalink / raw)
  To: Ian Campbell, xen-devel; +Cc: Boris Ostrovsky, george.dunlap, jbeulich


[-- Attachment #1.1: Type: text/plain, Size: 665 bytes --]

On Mon, 2015-11-09 at 14:00 +0000, Ian Campbell wrote:
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>

And, while we're here, I've been thinking since a while to try
implementing an xl interface for these counters... How bad of an idea
is that?

Is something like that possible already via Boris' PMU work?

Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 14:53 ` Dario Faggioli
@ 2015-11-09 15:02   ` Boris Ostrovsky
  2015-11-09 15:14     ` Dario Faggioli
  0 siblings, 1 reply; 9+ messages in thread
From: Boris Ostrovsky @ 2015-11-09 15:02 UTC (permalink / raw)
  To: Dario Faggioli, Ian Campbell, xen-devel; +Cc: george.dunlap, jbeulich

On 11/09/2015 09:53 AM, Dario Faggioli wrote:
> On Mon, 2015-11-09 at 14:00 +0000, Ian Campbell wrote:
>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>>
> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
>
> And, while we're here, I've been thinking since a while to try
> implementing an xl interface for these counters... How bad of an idea
> is that?
>
> Is something like that possible already via Boris' PMU work?

VPMU only covers CPU's hardware counters and this patch deals with 
software events in the hypervisor.

As far as xl accessibility --- doesn't xenperf already read them out?


-boris

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 15:02   ` Boris Ostrovsky
@ 2015-11-09 15:14     ` Dario Faggioli
  2015-11-09 15:23       ` Ian Campbell
  0 siblings, 1 reply; 9+ messages in thread
From: Dario Faggioli @ 2015-11-09 15:14 UTC (permalink / raw)
  To: Boris Ostrovsky, Ian Campbell, xen-devel; +Cc: george.dunlap, jbeulich


[-- Attachment #1.1: Type: text/plain, Size: 1305 bytes --]

On Mon, 2015-11-09 at 10:02 -0500, Boris Ostrovsky wrote:
> On 11/09/2015 09:53 AM, Dario Faggioli wrote:
> > On Mon, 2015-11-09 at 14:00 +0000, Ian Campbell wrote:
> > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > > 
> > Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
> > 
> > And, while we're here, I've been thinking since a while to try
> > implementing an xl interface for these counters... How bad of an
> > idea
> > is that?
> > 
> > Is something like that possible already via Boris' PMU work?
> 
> VPMU only covers CPU's hardware counters and this patch deals with 
> software events in the hypervisor.
> 
Right, I just wanted to be sure (I've planned to familiarize with that
work, but haven't got to doing it yet).

> As far as xl accessibility --- doesn't xenperf already read them out?
> 
Mmm... ISTR having tried without much luck, and having heard that it
wasn't functional any longer, but maybe I'm confusing it with something
else. I'll try again.

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 15:14     ` Dario Faggioli
@ 2015-11-09 15:23       ` Ian Campbell
  2015-11-09 15:47         ` Dario Faggioli
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Campbell @ 2015-11-09 15:23 UTC (permalink / raw)
  To: Dario Faggioli, Boris Ostrovsky, xen-devel; +Cc: george.dunlap, jbeulich

On Mon, 2015-11-09 at 16:14 +0100, Dario Faggioli wrote:
> 
> > As far as xl accessibility --- doesn't xenperf already read them out?
> > 
> Mmm... ISTR having tried without much luck, and having heard that it
> wasn't functional any longer, but maybe I'm confusing it with something
> else. I'll try again.

I happened to have an xterm with this in its scroll buffer from earlier:

root@marilith-n0:~# xenperf 
invalid hypercalls                  T=         0           0          0          0          0
trap: wfi                           T=     85068       56068      11762       8461       8777
trap: wfe                           T=      2811         614        716        964        517
trap: cp15 32-bit access            T=         4           1          1          1          1
trap: cp15 64-bit access            T=         0           0          0          0          0
trap: cp14 32-bit access            T=         0           0          0          0          0
trap: cp14 64-bit access            T=         0           0          0          0          0
trap: cp14 dbg access               T=         0           0          0          0          0
trap: cp access                     T=         0           0          0          0          0
trap: 32-bit smc                    T=         0           0          0          0          0
trap: 32-bit hvc                    T=      1291         510        568        161         52
trap: guest instr abort             T=         0           0          0          0          0
trap: guest data abort              T=     16446        6885       4358       3431       1772
trap: condition failed              T=         0           0          0          0          0
[...]

So I think it works.

You need to build the hypervisor binary with perfc=y (and optionally
perfc_arrays=y) or it doesn't do anything.

Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 15:23       ` Ian Campbell
@ 2015-11-09 15:47         ` Dario Faggioli
  2015-11-09 16:03           ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 9+ messages in thread
From: Dario Faggioli @ 2015-11-09 15:47 UTC (permalink / raw)
  To: Ian Campbell, Boris Ostrovsky, xen-devel; +Cc: george.dunlap, jbeulich


[-- Attachment #1.1: Type: text/plain, Size: 2483 bytes --]

On Mon, 2015-11-09 at 15:23 +0000, Ian Campbell wrote:
> On Mon, 2015-11-09 at 16:14 +0100, Dario Faggioli wrote:
> >  
> > > As far as xl accessibility --- doesn't xenperf already read them
> > > out?
> > > 
> > Mmm... ISTR having tried without much luck, and having heard that
> > it
> > wasn't functional any longer, but maybe I'm confusing it with
> > something
> > else. I'll try again.
> 
> I happened to have an xterm with this in its scroll buffer from
> earlier:
> 
> root@marilith-n0:~# xenperf 
> invalid hypercalls                  T=         0           0         
>  0          0          0
> trap: wfi                           T=     85068       56068     
>  11762       8461       8777
> trap: wfe                           T=      2811         614       
>  716        964        517
> trap: cp15 32-bit access            T=         4           1         
>  1          1          1
> trap: cp15 64-bit access            T=         0           0         
>  0          0          0
> trap: cp14 32-bit access            T=         0           0         
>  0          0          0
> trap: cp14 64-bit access            T=         0           0         
>  0          0          0
> trap: cp14 dbg access               T=         0           0         
>  0          0          0
> trap: cp access                     T=         0           0         
>  0          0          0
> trap: 32-bit smc                    T=         0           0         
>  0          0          0
> trap: 32-bit hvc                    T=      1291         510       
>  568        161         52
> trap: guest instr abort             T=         0           0         
>  0          0          0
> trap: guest data abort              T=     16446        6885      
>  4358       3431       1772
> trap: condition failed              T=         0           0         
>  0          0          0
> [...]
> 
> So I think it works.
> 
Ok, thanks for the confirmation, and sorry for the noise then.

> You need to build the hypervisor binary with perfc=y (and optionally
> perfc_arrays=y) or it doesn't do anything.
> 
Yeah, that I knew.

Thanks again and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH] perfc: count number of explicit vcpu yields
  2015-11-09 15:47         ` Dario Faggioli
@ 2015-11-09 16:03           ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-11-09 16:03 UTC (permalink / raw)
  To: Dario Faggioli
  Cc: Boris Ostrovsky, jbeulich, Ian Campbell, george.dunlap, xen-devel

On Mon, Nov 09, 2015 at 04:47:20PM +0100, Dario Faggioli wrote:
> On Mon, 2015-11-09 at 15:23 +0000, Ian Campbell wrote:
> > On Mon, 2015-11-09 at 16:14 +0100, Dario Faggioli wrote:
> > >  
> > > > As far as xl accessibility --- doesn't xenperf already read them
> > > > out?
> > > > 
> > > Mmm... ISTR having tried without much luck, and having heard that
> > > it
> > > wasn't functional any longer, but maybe I'm confusing it with
> > > something
> > > else. I'll try again.
> > 
> > I happened to have an xterm with this in its scroll buffer from
> > earlier:
> > 
> > root@marilith-n0:~# xenperf 
> > invalid hypercalls                  T=         0           0         
> >  0          0          0
> > trap: wfi                           T=     85068       56068     
> >  11762       8461       8777
> > trap: wfe                           T=      2811         614       
> >  716        964        517
> > trap: cp15 32-bit access            T=         4           1         
> >  1          1          1
> > trap: cp15 64-bit access            T=         0           0         
> >  0          0          0
> > trap: cp14 32-bit access            T=         0           0         
> >  0          0          0
> > trap: cp14 64-bit access            T=         0           0         
> >  0          0          0
> > trap: cp14 dbg access               T=         0           0         
> >  0          0          0
> > trap: cp access                     T=         0           0         
> >  0          0          0
> > trap: 32-bit smc                    T=         0           0         
> >  0          0          0
> > trap: 32-bit hvc                    T=      1291         510       
> >  568        161         52
> > trap: guest instr abort             T=         0           0         
> >  0          0          0
> > trap: guest data abort              T=     16446        6885      
> >  4358       3431       1772
> > trap: condition failed              T=         0           0         
> >  0          0          0
> > [...]
> > 
> > So I think it works.
> > 
> Ok, thanks for the confirmation, and sorry for the noise then.
> 
> > You need to build the hypervisor binary with perfc=y (and optionally
> > perfc_arrays=y) or it doesn't do anything.
> > 
> Yeah, that I knew.

And you need to apply an patch this patch for x86:

http://lists.xen.org/archives/html/xen-devel/2015-11/msg00633.html
since the lock_profile also adds tons of data in the 'struct spinlock'
making the 'struct domain' bigger than 4K (to 68K!).
> 
> Thanks again and Regards,
> Dario
> -- 
> <<This happens because I choose it to happen!>> (Raistlin Majere)
> -----------------------------------------------------------------
> Dario Faggioli, Ph.D, http://about.me/dario.faggioli
> Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
> 



> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2015-11-09 16:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09 14:00 [PATCH] perfc: count number of explicit vcpu yields Ian Campbell
2015-11-09 14:09 ` Jan Beulich
2015-11-09 14:14 ` George Dunlap
2015-11-09 14:53 ` Dario Faggioli
2015-11-09 15:02   ` Boris Ostrovsky
2015-11-09 15:14     ` Dario Faggioli
2015-11-09 15:23       ` Ian Campbell
2015-11-09 15:47         ` Dario Faggioli
2015-11-09 16:03           ` Konrad Rzeszutek Wilk

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.