Re: [RFC][PATCH 6/7] perf: use jump_label to optimize thescheduler hooks

From: Peter Zijlstra
Date: Sun Oct 17 2010 - 05:53:48 EST


On Thu, 2010-10-14 at 22:34 +0200, Peter Zijlstra wrote:
> +static inline void perf_event_task_sched_in(struct task_struct *task)
> +{
> + JUMP_LABEL(&perf_task_events, have_events);
> + return;
> +
> +have_events:
> + __perf_event_task_sched_in(task);
> +}

OK, so I hate the JUMP_LABEL() interface for it means we have to keep
writing these silly stubs.

How about something like:

#define COND_STMT(key, stmt) \
do { \
__label__ jl_enabled; \
JUMP_LABEL(key, jl_enabled); \
if (0) { \
jl_enabled: \
stmt; \
} \
} while (0)


--
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/