Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1269184 > unrolled thread
| Started by | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| First post | 2015-11-13 21:00 +0100 |
| Last post | 2015-11-13 21:20 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 4/4] sched: add trace event for idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-13 21:00 +0100
Re: [PATCH 4/4] sched: add trace event for idle injection kbuild test robot <lkp@intel.com> - 2015-11-13 21:20 +0100
| From | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| Date | 2015-11-13 21:00 +0100 |
| Subject | [PATCH 4/4] sched: add trace event for idle injection |
| Message-ID | <qusFQ-2eI-27@gated-at.bofh.it> |
Trace events for idle injection can be used to determine
timer activities for checking synchronization. In addition they
also helps to determine when the runqueue is throttled.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
---
include/linux/sched.h | 5 +++++
include/trace/events/sched.h | 25 +++++++++++++++++++++++++
kernel/sched/fair.c | 3 +++
3 files changed, 33 insertions(+)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ff551a3..99c79bf 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -3189,6 +3189,11 @@ extern int proc_sched_cfs_idle_inject_duration_handler(struct ctl_table *table,
int write,
void __user *buffer,
size_t *length, loff_t *ppos);
+enum cfs_idle_inject_action {
+ CFS_IDLE_INJECT_TIMER, /* timer sync point */
+ CFS_IDLE_INJECT_FORCED, /* idle forced in rq */
+ CFS_IDLE_INJECT_YIELD_SOFTIRQ /* yield to pending softirq */
+};
#endif
#endif
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 539d6bc..52c11c1 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -566,6 +566,31 @@ TRACE_EVENT(sched_wake_idle_without_ipi,
TP_printk("cpu=%d", __entry->cpu)
);
+
+#ifdef CONFIG_CFS_IDLE_INJECT
+/*
+ * Tracepoint for idle injection
+ */
+TRACE_EVENT(sched_cfs_idle_inject,
+
+ TP_PROTO(enum cfs_idle_inject_action action, int throttled),
+
+ TP_ARGS(action, throttled),
+
+ TP_STRUCT__entry(
+ __field(enum cfs_idle_inject_action, action)
+ __field(int, throttled)
+ ),
+
+ TP_fast_assign(
+ __entry->action = action;
+ __entry->throttled = throttled;
+ ),
+
+ TP_printk("action:%d throttled:%d", __entry->action, __entry->throttled)
+);
+#endif
+
#endif /* _TRACE_SCHED_H */
/* This part must be outside protection */
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a0cd777..20027eb 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5248,8 +5248,10 @@ idle:
if (in_forced_idle(cfs_rq)) {
if (unlikely(local_softirq_pending())) {
__unthrottle_cfs_rq(cfs_rq);
+ trace_sched_cfs_idle_inject(CFS_IDLE_INJECT_YIELD_SOFTIRQ, 1);
goto again;
}
+ trace_sched_cfs_idle_inject(CFS_IDLE_INJECT_FORCED, 1);
return NULL;
}
/*
@@ -8432,6 +8434,7 @@ static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *hrtimer)
throttle_rq(cpu);
}
raw_cpu_write(idle_injected, !status);
+ trace_sched_cfs_idle_inject(CFS_IDLE_INJECT_TIMER, !status);
return HRTIMER_RESTART;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2015-11-13 21:20 +0100 |
| Message-ID | <qusZb-2Cc-1@gated-at.bofh.it> |
| In reply to | #1269184 |
[Multipart message — attachments visible in raw view] — view raw
Hi Jacob,
[auto build test ERROR on: tip/sched/core]
[also build test ERROR on: v4.3 next-20151113]
url: https://github.com/0day-ci/linux/commits/Jacob-Pan/CFS-idle-injection/20151114-035732
config: cris-etrax-100lx_v2_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=cris
All errors (new ones prefixed by >>):
kernel/sched/fair.c: In function 'pick_next_task_fair':
>> kernel/sched/fair.c:5316:4: error: implicit declaration of function 'trace_sched_cfs_idle_inject' [-Werror=implicit-function-declaration]
>> kernel/sched/fair.c:5316:32: error: 'CFS_IDLE_INJECT_YIELD_SOFTIRQ' undeclared (first use in this function)
kernel/sched/fair.c:5316:32: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/sched/fair.c:5319:31: error: 'CFS_IDLE_INJECT_FORCED' undeclared (first use in this function)
cc1: some warnings being treated as errors
vim +/trace_sched_cfs_idle_inject +5316 kernel/sched/fair.c
5310 return p;
5311
5312 idle:
5313 if (in_forced_idle(cfs_rq)) {
5314 if (unlikely(local_softirq_pending())) {
5315 __unthrottle_cfs_rq(cfs_rq);
> 5316 trace_sched_cfs_idle_inject(CFS_IDLE_INJECT_YIELD_SOFTIRQ, 1);
5317 goto again;
5318 }
> 5319 trace_sched_cfs_idle_inject(CFS_IDLE_INJECT_FORCED, 1);
5320 return NULL;
5321 }
5322 /*
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web