From 07eb3f803b419bdebad45d846113dc069307be90 Mon Sep 17 00:00:00 2001 From: Joonwoo Park Date: Mon, 31 Aug 2015 17:21:35 -0700 Subject: sched: select task's prev_cpu as the best CPU when it was chosen recently Select given task's prev_cpu when the task slept for short period to reduce latency of task placement and migrations. A new tunable /proc/sys/kernel/sched_select_prev_cpu_us introduced to determine whether tasks are eligible to go through fast path. CRs-fixed: 947467 Change-Id: Ia507665b91f4e9f0e6ee1448d8df8994ead9739a [joonwoop@codeaurora.org: fixed conflict in include/linux/sched.h, include/linux/sched/sysctl.h, kernel/sched/core.c and kernel/sysctl.c] Signed-off-by: Joonwoo Park --- include/trace/events/sched.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'include/trace') diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 979758d8702e..fc9c0d768c68 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -112,9 +112,9 @@ TRACE_EVENT(sched_enq_deq_task, TRACE_EVENT(sched_task_load, TP_PROTO(struct task_struct *p, bool boost, int reason, - bool sync, bool need_idle, int best_cpu), + bool sync, bool need_idle, bool fast_path, int best_cpu), - TP_ARGS(p, boost, reason, sync, need_idle, best_cpu), + TP_ARGS(p, boost, reason, sync, need_idle, fast_path, best_cpu), TP_STRUCT__entry( __array( char, comm, TASK_COMM_LEN ) @@ -124,6 +124,7 @@ TRACE_EVENT(sched_task_load, __field( int, reason ) __field( bool, sync ) __field( bool, need_idle ) + __field( bool, fast_path ) __field( int, best_cpu ) __field( u64, latency ) ), @@ -136,16 +137,18 @@ TRACE_EVENT(sched_task_load, __entry->reason = reason; __entry->sync = sync; __entry->need_idle = need_idle; + __entry->fast_path = fast_path; __entry->best_cpu = best_cpu; __entry->latency = p->state == TASK_WAKING ? sched_ktime_clock() - p->ravg.mark_start : 0; ), - TP_printk("%d (%s): demand=%u boost=%d reason=%d sync=%d need_idle=%d best_cpu=%d latency=%llu", + TP_printk("%d (%s): demand=%u boost=%d reason=%d sync=%d need_idle=%d fast_path=%d best_cpu=%d latency=%llu", __entry->pid, __entry->comm, __entry->demand, __entry->boost, __entry->reason, __entry->sync, - __entry->need_idle, __entry->best_cpu, __entry->latency) + __entry->need_idle, __entry->fast_path, + __entry->best_cpu, __entry->latency) ); DECLARE_EVENT_CLASS(sched_cpu_load, -- cgit v1.2.3