Re: [PATCH] perf_event: fix slow and broken cgroup context switchcode

From: Peter Zijlstra
Date: Thu Aug 25 2011 - 10:22:43 EST


On Thu, 2011-08-25 at 15:58 +0200, Stephane Eranian wrote:
> +static inline void perf_event_task_sched_in(struct task_struct *prev,
> + struct task_struct *task)
> {
> if (static_branch(&perf_sched_events))
> + __perf_event_task_sched_in(prev, task);
> }
>
> +static inline void perf_event_task_sched_out(struct task_struct *prev,
> + struct task_struct *next)
> {
> perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
>
> + if (static_branch(&perf_sched_events))
> + __perf_event_task_sched_out(prev, next);
> }

BTW, Ingo, is there any particular reason we have these two calls and
not a single perf_event_task_switch() call?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/