[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1236350377.6326.389.camel@laptop>
Date: Fri, 06 Mar 2009 15:39:37 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
Oleg Nesterov <onestero@...hat.com>,
Nick Piggin <npiggin@...e.de>
Cc: lkml <linux-kernel@...r.kernel.org>
Subject: [RFC][PATCH]: wait: don't resched in prepare_to_wait()
Does the below make sense?
After prepare to wait, we either call schedule() or find !cond in which
case we'll call finish_wait() which contains another preemption check.
Not-signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
---
kernel/wait.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/kernel/wait.c b/kernel/wait.c
index 42a2dbc..7b866ab 100644
--- a/kernel/wait.c
+++ b/kernel/wait.c
@@ -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();
}
EXPORT_SYMBOL(prepare_to_wait);
@@ -87,7 +89,9 @@ prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state)
if (list_empty(&wait->task_list))
__add_wait_queue_tail(q, wait);
set_current_state(state);
+ preempt_disable();
spin_unlock_irqrestore(&q->lock, flags);
+ preempt_enable_no_resched();
}
EXPORT_SYMBOL(prepare_to_wait_exclusive);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists