[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c232d92d5d70daf9b2c58486dc5a182f95edd951.1397562542.git.yangds.fnst@cn.fujitsu.com>
Date: Tue, 15 Apr 2014 21:32:52 +0900
From: Dongsheng Yang <yangds.fnst@...fujitsu.com>
To: <rostedt@...dmis.org>, <fweisbec@...il.com>, <mingo@...hat.com>,
<peterz@...radead.org>, <acme@...stprotocols.net>
CC: <linux-kernel@...r.kernel.org>,
Dongsheng <yangds.fnst@...fujitsu.com>
Subject: [PATCH 3/8] sched/wait: Use __add_wait_queue{_tail}_exclusive() as possible.
From: Dongsheng <yangds.fnst@...fujitsu.com>
There is already a function in include/linux/wait.h to cover the
'exclusive' usage. So we can use it in sched/wait.c to replace
the opened implementation of it.
Signed-off-by: Dongsheng <yangds.fnst@...fujitsu.com>
---
kernel/sched/wait.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
index 283750e..b04827e 100644
--- a/kernel/sched/wait.c
+++ b/kernel/sched/wait.c
@@ -38,9 +38,8 @@ void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
unsigned long flags;
trace_sched_wait(current);
- wait->flags |= WQ_FLAG_EXCLUSIVE;
spin_lock_irqsave(&q->lock, flags);
- __add_wait_queue_tail(q, wait);
+ __add_wait_queue_tail_exclusive(q, wait);
spin_unlock_irqrestore(&q->lock, flags);
}
EXPORT_SYMBOL(add_wait_queue_exclusive);
@@ -192,10 +191,9 @@ prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state)
unsigned long flags;
trace_sched_wait(current);
- wait->flags |= WQ_FLAG_EXCLUSIVE;
spin_lock_irqsave(&q->lock, flags);
if (list_empty(&wait->task_list))
- __add_wait_queue_tail(q, wait);
+ __add_wait_queue_tail_exclusive(q, wait);
set_current_state(state);
spin_unlock_irqrestore(&q->lock, flags);
}
--
1.8.2.1
--
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