Re: [PATCH v2][RFC] tracing/context-tracking: Addpreempt_schedule_context() for tracing

From: Steven Rostedt
Date: Wed Jun 05 2013 - 22:49:56 EST


On Wed, 2013-06-05 at 09:41 -0400, Steven Rostedt wrote:
> >
> > If preempt_enable_notrace() is the only user, why does this live in
> > kernel/context_tracking.c and not in kernel/sched/core.c?
>
> Then we would need to add #ifdef CONFIG_CONTEXT_TRACKING around it too.
> As we have in preempt.h:
>
> #ifdef CONFIG_CONTEXT_TRACKING
>
> void preempt_schedule_context(void);
>
> #define preempt_check_resched_context() \
> do { \
> if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
> preempt_schedule_context(); \
> } while(0)
> #else
>
> #define preempt_check_resched_context() preempt_check_resched()
>
> #endif
>
> Seemed like it was more appropriate to be in context_tracking.c than
> sched/core.c, as it depends on context tracking.
>

Peter,

Are you fine with this answer, or do you still believe I should put it
into sched/core.c?


> > > +EXPORT_SYMBOL(preempt_schedule_context);
> >
> > Do we really need to export this?
>
> As preempt_enable_notrace() is also used by tracepoints, yes. Because
> tracepoints are used by modules. Hmm, now it may be exported via a GPL
> export though.
>

I switched it to EXPORT_SYMBOL_GPL, so that only GPL modules may use
preempt_enable_notrace().

Are you OK with this?

Here's the new patch: