Re: [RFC][PATCH]: wait: don't resched in prepare_to_wait()

From: Oleg Nesterov
Date: Fri Mar 06 2009 - 10:45:13 EST


On 03/06, Peter Zijlstra wrote:
>
> After prepare to wait, we either call schedule() or find !cond in which
> case we'll call finish_wait() which contains another preemption check.
>
> @@ -73,7 +73,9 @@ prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state)
> if (list_empty(&wait->task_list))
> __add_wait_queue(q, wait);
> set_current_state(state);
> + preempt_disable();
> spin_unlock_irqrestore(&q->lock, flags);
> + preempt_enable_no_resched();

But this only helps if the task gets TIF_NEED_RESCHED while it was in
spin_lock_irqsave() section, right? This window should be very small
unless we have the contention.

Or do you have something else in mind?

Oleg.

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