[RT] possible bug in trace_start_sched_wakeup

From: Steven Rostedt
Date: Thu Jan 26 2006 - 20:55:25 EST


Ingo,

I've been agonizing over the latency code, and have a question about
__trace_start_sched_wakup.

Here we have:

void __trace_start_sched_wakeup(struct task_struct *p)
{
struct cpu_trace *tr;
int cpu;

if (trace_user_triggered || !wakeup_timing)
return;

spin_lock(&sch.trace_lock);
if (sch.task && (sch.task->prio >= p->prio))
goto out_unlock;


I don't get the sch.task->prio >= p->prio. Here the lower the number
the greater the priority. So this if statement is saying:

If sch.task is either NULL or if p is greater in priority than or equal
to the priority of sch.task then quit.

Then again later in trace_stop_sched_switched:

if (sch.task && (sch.task->prio >= p->prio))
sch.task = NULL;

Again, if p is a higher priority than sch.task we set sch.task to NULL??


What am I missing here?

Thanks,

-- Steve

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