From b9e7900a8ad0dc9ffe416567841cb606f1689133 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 14 Oct 2013 12:38:19 +0100 Subject: smp: Don't use typedef to work around compiler issue with tracepoints Having the typedef in place for the tracepoints causes compiler crashes in some situations. Just using void * directly avoids triggering the issue and should have no effect on the trace. Signed-off-by: Mark Brown Acked-by: Liviu Dudau --- include/trace/events/smp.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/trace/events/smp.h b/include/trace/events/smp.h index c8abfd744723..da0baf27a39a 100644 --- a/include/trace/events/smp.h +++ b/include/trace/events/smp.h @@ -5,11 +5,10 @@ #define _TRACE_SMP_H #include -typedef void (*__smp_call_func_t)(void *info); DECLARE_EVENT_CLASS(smp_call_class, - TP_PROTO(__smp_call_func_t fnc), + TP_PROTO(void * fnc), TP_ARGS(fnc), @@ -35,7 +34,7 @@ DECLARE_EVENT_CLASS(smp_call_class, */ DEFINE_EVENT(smp_call_class, smp_call_func_entry, - TP_PROTO(__smp_call_func_t fnc), + TP_PROTO(void * fnc), TP_ARGS(fnc) ); @@ -51,7 +50,7 @@ DEFINE_EVENT(smp_call_class, smp_call_func_entry, */ DEFINE_EVENT(smp_call_class, smp_call_func_exit, - TP_PROTO(__smp_call_func_t fnc), + TP_PROTO(void * fnc), TP_ARGS(fnc) ); @@ -67,7 +66,7 @@ DEFINE_EVENT(smp_call_class, smp_call_func_exit, */ TRACE_EVENT(smp_call_func_send, - TP_PROTO(__smp_call_func_t func, int dest), + TP_PROTO(void * func, int dest), TP_ARGS(func, dest), -- cgit v1.2.3 From 2a68d1e9125582bedeac4ea34fb9901ab1f7de11 Mon Sep 17 00:00:00 2001 From: Mathieu Poirier Date: Wed, 20 Nov 2013 14:20:42 +0000 Subject: HMP: Avoid using the cpu stopper to stop runnable tasks When migrating a runnable task, we use the CPU stopper on the source CPU to ensure that the task to be moved is not currently running. Before this patch, all forced migrations (up, offload, idle pull) use the stopper for every migration. Using the CPU stopper is mandatory only when a task is currently running on a CPU. Otherwise tasks can be moved by locking the source and destination run queues. This patch checks to see if the task to be moved are currently running. If not the task is moved directly without using the stopper thread. Signed-off-by: Mathieu Poirier Signed-off-by: Jon Medhurst --- include/trace/events/sched.h | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'include') diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 66dc53bca19a..2afcb71857fd 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -579,6 +579,55 @@ TRACE_EVENT(sched_task_usage_ratio, __entry->ratio) ); +/* + * Tracepoint for HMP (CONFIG_SCHED_HMP) task migrations, + * marking the forced transition of runnable or running tasks. + */ +TRACE_EVENT(sched_hmp_migrate_force_running, + + TP_PROTO(struct task_struct *tsk, int running), + + TP_ARGS(tsk, running), + + TP_STRUCT__entry( + __array(char, comm, TASK_COMM_LEN) + __field(int, running) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->running = running; + ), + + TP_printk("running=%d comm=%s", + __entry->running, __entry->comm) +); + +/* + * Tracepoint for HMP (CONFIG_SCHED_HMP) task migrations, + * marking the forced transition of runnable or running + * tasks when a task is about to go idle. + */ +TRACE_EVENT(sched_hmp_migrate_idle_running, + + TP_PROTO(struct task_struct *tsk, int running), + + TP_ARGS(tsk, running), + + TP_STRUCT__entry( + __array(char, comm, TASK_COMM_LEN) + __field(int, running) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->running = running; + ), + + TP_printk("running=%d comm=%s", + __entry->running, __entry->comm) +); + /* * Tracepoint for HMP (CONFIG_SCHED_HMP) task migrations. */ -- cgit v1.2.3