Right. It is a confusing though - depending on the value of p->cpu
relative to current->cpu, the synchronous flag may be ignored. Since the
relationship between p->cpu and current->cpu is essentially random, this
makes the behavior of the synchronous flag random - why bother?
I can see that re-grabbing the locks in the proper order would be a pain.
Also, after a quick grep, it appears only fs/pipe.c is interested in the
wake_up_sync() variant. Maybe this feature should just be culled?
-Kevin
The try_to_wake_up function in pre11 (just for reference):
static int try_to_wake_up(task_t * p, int synchronous)
{
unsigned long flags;
int success = 0;
runqueue_t *rq;
lock_task_rq(rq, p, flags);
p->state = TASK_RUNNING;
if (!p->array) {
if (!rt_task(p) && synchronous && (smp_processor_id() < p->cpu)) {
spin_lock(&this_rq()->lock);
p->cpu = smp_processor_id();
activate_task(p, this_rq());
spin_unlock(&this_rq()->lock);
} else {
activate_task(p, rq);
if ((rq->curr == rq->idle) ||
(p->prio < rq->curr->prio))
resched_task(rq->curr);
}
success = 1;
}
unlock_task_rq(rq, p, flags);
return success;
}
-- ------------------------------------------------------------------------ | Kevin O'Connor "BTW, IMHO we need a FAQ for | | kevin@koconnor.net 'IMHO', 'FAQ', 'BTW', etc. !" | ------------------------------------------------------------------------ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/