From: George Dunlap <george.dunlap@eu.citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
"Keir (Xen.org)" <keir@xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH 5 of 5 v3] xen: sched_credit: add some tracing
Date: Tue, 18 Dec 2012 12:15:35 +0000 [thread overview]
Message-ID: <50D05E67.6070408@eu.citrix.com> (raw)
In-Reply-To: <47fe4d3554d40c6b4062.1355783342@Solace>
On 17/12/12 22:29, Dario Faggioli wrote:
> About tickling, and PCPU selection.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
> Changes from v2:
> * Call to `trace_var()' converted to `__trace_var()', as it originally
> was (something got messed up while reworking this for v2.
> Thanks George. :-) )
>
> Changes from v1:
> * Dummy `struct d {}', accommodating `cpu' only, removed
> in spite of the much more readable `trace_var(..., sizeof(cpu), &cpu)',
> as suggested.
>
> diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
> --- a/xen/common/sched_credit.c
> +++ b/xen/common/sched_credit.c
> @@ -21,6 +21,7 @@
> #include <asm/atomic.h>
> #include <xen/errno.h>
> #include <xen/keyhandler.h>
> +#include <xen/trace.h>
>
>
> /*
> @@ -98,6 +99,18 @@
>
>
> /*
> + * Credit tracing events ("only" 512 available!). Check
> + * include/public/trace.h for more details.
> + */
> +#define TRC_CSCHED_SCHED_TASKLET TRC_SCHED_CLASS_EVT(CSCHED, 1)
> +#define TRC_CSCHED_ACCOUNT_START TRC_SCHED_CLASS_EVT(CSCHED, 2)
> +#define TRC_CSCHED_ACCOUNT_STOP TRC_SCHED_CLASS_EVT(CSCHED, 3)
> +#define TRC_CSCHED_STOLEN_VCPU TRC_SCHED_CLASS_EVT(CSCHED, 4)
> +#define TRC_CSCHED_PICKED_CPU TRC_SCHED_CLASS_EVT(CSCHED, 5)
> +#define TRC_CSCHED_TICKLE TRC_SCHED_CLASS_EVT(CSCHED, 6)
> +
> +
> +/*
> * Boot parameters
> */
> static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
> @@ -316,9 +329,18 @@ static inline void
> }
> }
>
> - /* Send scheduler interrupts to designated CPUs */
> if ( !cpumask_empty(&mask) )
> + {
> + if ( unlikely(tb_init_done) )
> + {
> + /* Avoid TRACE_*: saves checking !tb_init_done each step */
> + for_each_cpu(cpu, &mask)
> + __trace_var(TRC_CSCHED_TICKLE, 0, sizeof(cpu), &cpu);
> + }
> +
> + /* Send scheduler interrupts to designated CPUs */
> cpumask_raise_softirq(&mask, SCHEDULE_SOFTIRQ);
> + }
> }
>
> static void
> @@ -555,6 +577,8 @@ static int
> if ( commit && spc )
> spc->idle_bias = cpu;
>
> + TRACE_3D(TRC_CSCHED_PICKED_CPU, vc->domain->domain_id, vc->vcpu_id, cpu);
> +
> return cpu;
> }
>
> @@ -587,6 +611,9 @@ static inline void
> }
> }
>
> + TRACE_3D(TRC_CSCHED_ACCOUNT_START, sdom->dom->domain_id,
> + svc->vcpu->vcpu_id, sdom->active_vcpu_count);
> +
> spin_unlock_irqrestore(&prv->lock, flags);
> }
>
> @@ -609,6 +636,9 @@ static inline void
> {
> list_del_init(&sdom->active_sdom_elem);
> }
> +
> + TRACE_3D(TRC_CSCHED_ACCOUNT_STOP, sdom->dom->domain_id,
> + svc->vcpu->vcpu_id, sdom->active_vcpu_count);
> }
>
> static void
> @@ -1242,6 +1272,8 @@ csched_runq_steal(int peer_cpu, int cpu,
> if (__csched_vcpu_is_migrateable(vc, cpu))
> {
> /* We got a candidate. Grab it! */
> + TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
> + vc->domain->domain_id, vc->vcpu_id);
> SCHED_VCPU_STAT_CRANK(speer, migrate_q);
> SCHED_STAT_CRANK(migrate_queued);
> WARN_ON(vc->is_urgent);
> @@ -1402,6 +1434,7 @@ csched_schedule(
> /* Tasklet work (which runs in idle VCPU context) overrides all else. */
> if ( tasklet_work_scheduled )
> {
> + TRACE_0D(TRC_CSCHED_SCHED_TASKLET);
> snext = CSCHED_VCPU(idle_vcpu[cpu]);
> snext->pri = CSCHED_PRI_TS_BOOST;
> }
>
next prev parent reply other threads:[~2012-12-18 12:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 22:28 [PATCH 0 of 5 v3] xen: sched_credit: fix picking and tickling and add some tracing Dario Faggioli
2012-12-17 22:28 ` [PATCH 1 of 5 v3] xen: sched_credit: define and use curr_on_cpu(cpu) Dario Faggioli
2012-12-18 12:10 ` George Dunlap
2012-12-17 22:28 ` [PATCH 2 of 5 v3] xen: sched_credit: improve picking up the idle CPU for a VCPU Dario Faggioli
2012-12-18 12:12 ` George Dunlap
2012-12-17 22:29 ` [PATCH 3 of 5 v3] xen: sched_credit: improve tickling of idle CPUs Dario Faggioli
2012-12-17 22:29 ` [PATCH 4 of 5 v3] xen: tracing: introduce per-scheduler trace event IDs Dario Faggioli
2013-03-08 16:08 ` George Dunlap
2013-03-09 10:40 ` Dario Faggioli
2013-03-11 10:57 ` George Dunlap
2013-03-11 19:10 ` Dario Faggioli
2012-12-17 22:29 ` [PATCH 5 of 5 v3] xen: sched_credit: add some tracing Dario Faggioli
2012-12-18 12:15 ` George Dunlap [this message]
2012-12-18 12:16 ` [PATCH 0 of 5 v3] xen: sched_credit: fix picking and tickling and " George Dunlap
2012-12-18 14:16 ` Dario Faggioli
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=50D05E67.6070408@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xensource.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).