Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

From: Ingo Molnar
Date: Wed Jun 08 2016 - 03:56:27 EST



* Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:

> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -789,6 +789,13 @@ static void update_curr_fair(struct rq *rq)
> update_curr(cfs_rq_of(&rq->curr->se));
> }
>
> +void trace_sched_stat_register(void)
> +{
> +#ifdef CONFIG_SCHEDSTATS
> + force_schedstat_enabled();
> +#endif
> +}

I think it would be cleaner to provide an empty force_schedstat_enabled()
definition in sched.h, on !CONFIG_SCHEDSTATS.

But it might make sense to further decouple schedstats from tracing?

Thanks,

Ingo