From: Dario Faggioli <dfaggioli@suse.com>
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [RFC PATCH v1 16/16] xen/tools: tracing of Credit1 SMT domain co-scheduling support
Date: Sat, 25 Aug 2018 01:37:04 +0200 [thread overview]
Message-ID: <153515382462.8598.18315420378409166132.stgit@Istar.fritz.box> (raw)
In-Reply-To: <153515305655.8598.6054293649487840735.stgit@Istar.fritz.box>
Introduce some new event, related to SMT-aware domain co-scheduling,
in Credit1 code, and their handling and parsing in xenalyze.
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
TODO:
- deal with xentrace_format.
---
tools/xentrace/xenalyze.c | 74 +++++++++++++++++++++++++++++++++++++++++++--
xen/common/sched_credit.c | 20 ++++++++++++
2 files changed, 91 insertions(+), 3 deletions(-)
diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
index a1e2531945..1d586d30b1 100644
--- a/tools/xentrace/xenalyze.c
+++ b/tools/xentrace/xenalyze.c
@@ -7417,6 +7417,18 @@ void dump_sched_vcpu_action(struct record_info *ri, const char *action)
printf(" %s %s d%uv%u\n", ri->dump_header, action, r->domid, r->vcpuid);
}
+static inline const char *csched_pri_to_string(int pri)
+{
+ switch(pri)
+ {
+ case 0: return "BOOST";
+ case -1: return "UNDER";
+ case -2: return "OVER";
+ case -64: return "IDLE";
+ default: return "";
+ }
+}
+
void sched_process(struct pcpu_info *p)
{
struct record_info *ri = &p->ri;
@@ -7632,12 +7644,19 @@ void sched_process(struct pcpu_info *p)
if(opt.dump_all) {
struct {
unsigned int cpu:16, tasklet:8, idle:8;
+ unsigned int vcpuid:16, domid:16;
+ int pri, cosc_dom;
} *r = (typeof(r))ri->d;
- printf(" %s csched:schedule cpu %u%s%s\n",
+ printf(" %s csched:schedule cpu %u curr=d%uv%u prio=%s%s%s",
ri->dump_header, r->cpu,
- r->tasklet ? ", tasklet scheduled" : "",
- r->idle ? ", idle" : ", busy");
+ r->domid, r->vcpuid, csched_pri_to_string(r->pri),
+ r->idle ? ", (idle)" : ", (busy)",
+ r->tasklet ? ", tasklet scheduled" : "");
+ if (r->cosc_dom != -1)
+ printf(", cosched=d%d\n", r->cosc_dom);
+ else
+ printf(", cosched=/\n");
}
break;
case TRC_SCHED_CLASS_EVT(CSCHED, 10): /* RATELIMIT */
@@ -7666,6 +7685,55 @@ void sched_process(struct pcpu_info *p)
r->check < 0 ? -r->check : r->check);
}
break;
+ case TRC_SCHED_CLASS_EVT(CSCHED, 12): /* RUNQ_NEXT */
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid, vcpuid;
+ int pri;
+ } *r = (typeof(r))ri->d;
+
+ printf(" %s csched:runq_next d%uv%u prio=%s\n",
+ ri->dump_header, r->domid, r->vcpuid,
+ csched_pri_to_string(r->pri));
+ }
+ break;
+ case TRC_SCHED_CLASS_EVT(CSCHED, 13): /* COSCHED_DOM */
+ if(opt.dump_all) {
+ struct {
+ int cosc_dom;
+ } *r = (typeof(r))ri->d;
+
+ printf(" %s csched:smt_cosched_dom=", ri->dump_header);
+ if (r->cosc_dom != -1)
+ printf("%d\n", r->cosc_dom);
+ else
+ printf("/\n");
+ }
+ break;
+ case TRC_SCHED_CLASS_EVT(CSCHED, 14): /* RUNQ_CHECK */
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid, vcpuid;
+ int pri;
+ } *r = (typeof(r))ri->d;
+
+ printf(" %s csched:runq_check d%uv%u prio=%s\n",
+ ri->dump_header, r->domid, r->vcpuid,
+ csched_pri_to_string(r->pri));
+ }
+ break;
+ case TRC_SCHED_CLASS_EVT(CSCHED, 15): /* STEAL_DCHECK */
+ if(opt.dump_all) {
+ struct {
+ unsigned int domid, vcpuid;
+ int pri;
+ } *r = (typeof(r))ri->d;
+
+ printf(" %s csched:steal_dom_check d%uv%u prio=%s\n",
+ ri->dump_header, r->domid, r->vcpuid,
+ csched_pri_to_string(r->pri));
+ }
+ break;
/* CREDIT 2 (TRC_CSCHED2_xxx) */
case TRC_SCHED_CLASS_EVT(CSCHED2, 1): /* TICK */
case TRC_SCHED_CLASS_EVT(CSCHED2, 4): /* CREDIT_ADD */
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index aecb4e3e05..fc64f58c23 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -136,6 +136,10 @@
#define TRC_CSCHED_SCHEDULE TRC_SCHED_CLASS_EVT(CSCHED, 9)
#define TRC_CSCHED_RATELIMIT TRC_SCHED_CLASS_EVT(CSCHED, 10)
#define TRC_CSCHED_STEAL_CHECK TRC_SCHED_CLASS_EVT(CSCHED, 11)
+#define TRC_CSCHED_RUNQ_NEXT TRC_SCHED_CLASS_EVT(CSCHED, 12)
+#define TRC_CSCHED_COSCHED_DOM TRC_SCHED_CLASS_EVT(CSCHED, 13)
+#define TRC_CSCHED_RUNQ_CHECK TRC_SCHED_CLASS_EVT(CSCHED, 14)
+#define TRC_CSCHED_STEAL_DCHECK TRC_SCHED_CLASS_EVT(CSCHED, 15)
/*
* Boot parameters
@@ -1785,6 +1789,8 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
list_for_each( iter, &peer_pcpu->runq )
{
speer = __runq_elem(iter);
+ TRACE_3D(TRC_CSCHED_STEAL_DCHECK, speer->vcpu->domain->domain_id,
+ speer->vcpu->vcpu_id, speer->pri);
/*
* If next available VCPU here is not of strictly higher
@@ -2024,10 +2030,17 @@ csched_schedule(
{
struct {
unsigned cpu:16, tasklet:8, idle:8;
+ unsigned vcpu:16, dom:16;
+ int pri, cosc_dom;
} d;
d.cpu = cpu;
d.tasklet = tasklet_work_scheduled;
d.idle = is_idle_vcpu(current);
+ d.dom = scurr->vcpu->domain->domain_id;
+ d.vcpu = scurr->vcpu->vcpu_id;
+ d.pri = scurr->pri;
+ d.cosc_dom = !sched_smt_cosched || !spc->core->sdom ?
+ -1 : spc->core->sdom->dom->domain_id;
__trace_var(TRC_CSCHED_SCHEDULE, 1, sizeof(d),
(unsigned char *)&d);
}
@@ -2135,6 +2148,8 @@ csched_schedule(
spc->core->sdom = NULL;
snext = __runq_elem(runq->next);
+ TRACE_3D(TRC_CSCHED_RUNQ_NEXT, snext->vcpu->domain->domain_id,
+ snext->vcpu->vcpu_id, snext->pri);
/*
* If domain co-scheduling is enabled, and a domain is running already
@@ -2152,6 +2167,8 @@ csched_schedule(
list_for_each( iter, runq )
{
siter = __runq_elem(iter);
+ TRACE_3D(TRC_CSCHED_RUNQ_CHECK, siter->vcpu->domain->domain_id,
+ siter->vcpu->vcpu_id, snext->pri);
/*
* Don't pick up a vcpu which has lower priority than snext, or
@@ -2219,6 +2236,9 @@ csched_schedule(
}
}
+ TRACE_1D(TRC_CSCHED_COSCHED_DOM, spc->core->sdom == NULL ?
+ -1 : spc->core->sdom->dom->domain_id);
+
spin_unlock(&spc->core->lock);
/*
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-08-24 23:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-24 23:35 [RFC PATCH v1 00/16] xen: sched: implement core-scheduling Dario Faggioli
2018-08-24 23:35 ` [RFC PATCH v1 01/16] xen: Credit1: count runnable vcpus, not running ones Dario Faggioli
2018-08-24 23:35 ` [RFC PATCH v1 02/16] xen: Credit1: always steal from pcpus with runnable but not running vcpus Dario Faggioli
2018-08-24 23:35 ` [RFC PATCH v1 03/16] xen: Credit1: do not always tickle an idle pcpu Dario Faggioli
2018-08-24 23:35 ` [RFC PATCH v1 04/16] xen: sched: make the logic for tracking idle core generic Dario Faggioli
2018-08-24 23:35 ` [RFC PATCH v1 05/16] xen: Credit1: track fully idle cores Dario Faggioli
2018-08-24 23:35 ` [RFC PATCH v1 06/16] xen: Credit1: check for fully idle cores when tickling Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 07/16] xen: Credit1: reorg __runq_tickle() code a bit Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 08/16] xen: Credit1: reorg csched_schedule() " Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 09/16] xen: Credit1: SMT-aware domain co-scheduling parameter and data structs Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 10/16] xen: Credit1: support sched_smt_cosched in csched_schedule() Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 11/16] xen: Credit1: support sched_smt_cosched in _csched_cpu_pick() Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 12/16] xen: Credit1: support sched_smt_cosched in csched_runq_steal() Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 13/16] xen: Credit1: sched_smt_cosched support in __csched_vcpu_is_migrateable() Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 14/16] xen: Credit1: sched_smt_cosched support in __runq_tickle() for pinned vcpus Dario Faggioli
2018-08-24 23:36 ` [RFC PATCH v1 15/16] xen: Credit1: sched_smt_cosched support in __runq_tickle() Dario Faggioli
2018-08-24 23:37 ` Dario Faggioli [this message]
2018-09-07 16:00 ` [RFC PATCH v1 00/16] xen: sched: implement core-scheduling Juergen Gross
2018-10-11 17:37 ` Dario Faggioli
2018-10-12 5:15 ` Juergen Gross
2018-10-12 7:49 ` Dario Faggioli
2018-10-12 8:35 ` Juergen Gross
2018-10-12 9:15 ` Dario Faggioli
2018-10-12 9:23 ` Juergen Gross
2018-10-18 10:40 ` Dario Faggioli
2018-10-17 21:36 ` Tamas K Lengyel
2018-10-18 8:16 ` Dario Faggioli
2018-10-18 12:55 ` Tamas K Lengyel
2018-10-18 13:48 ` 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=153515382462.8598.18315420378409166132.stgit@Istar.fritz.box \
--to=dfaggioli@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).