Re: [PATCH, RFC] protect call to set_tsk_need_resched() by the rq-lock

From: Ingo Molnar
Date: Wed Dec 08 2004 - 03:32:32 EST



* Michael Buesch <mbuesch@xxxxxxxxxx> wrote:

> > > The two attached patches (one against vanilla kernel and one
> > > against ck patchset) moves the rq-lock a few lines up in
> > > scheduler_tick() to also protect set_tsk_need_resched().
> > >
> > > Is that neccessary?
> >
> > scheduler_tick() is a special case, 'current' is pinned and cannot
> > go away, nor can it get off the runqueue.
>
> Can you explain in short, why this is the case, please? I don't really
> get behind it. How are the two things enforced?

'current' is the currently executing task and as such it wont get moved
off the runqueue. The only way to leave the runqueue is to execute
schedule() [or to be preempted].

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