All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	peterz@infradead.org, oleg@redhat.com, tglx@linutronix.de
Subject: [tip:sched/core] sched/wait: Collapse __wait_event_interruptible_timeout()
Date: Fri, 4 Oct 2013 10:34:38 -0700	[thread overview]
Message-ID: <tip-c2ebb1fb4eddf3d1d66fe31d1e89e83ee211b81c@git.kernel.org> (raw)
In-Reply-To: <20131002092528.469616907@infradead.org>

Commit-ID:  c2ebb1fb4eddf3d1d66fe31d1e89e83ee211b81c
Gitweb:     http://git.kernel.org/tip/c2ebb1fb4eddf3d1d66fe31d1e89e83ee211b81c
Author:     Peter Zijlstra <peterz@infradead.org>
AuthorDate: Wed, 2 Oct 2013 11:22:25 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 4 Oct 2013 10:14:49 +0200

sched/wait: Collapse __wait_event_interruptible_timeout()

Reduce macro complexity by using the new ___wait_event() helper.
No change in behaviour, identical generated code.

Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131002092528.469616907@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/wait.h | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 39e4bbd..a79fb15 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -304,21 +304,9 @@ do {									\
 })
 
 #define __wait_event_interruptible_timeout(wq, condition, ret)		\
-do {									\
-	DEFINE_WAIT(__wait);						\
-									\
-	for (;;) {							\
-		prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE);	\
-		if (___wait_cond_timeout(condition, ret))		\
-			break;						\
-		if (signal_pending(current)) {				\
-			ret = -ERESTARTSYS;				\
-			break;						\
-		}							\
-		ret = schedule_timeout(ret);				\
-	}								\
-	finish_wait(&wq, &__wait);					\
-} while (0)
+	___wait_event(wq, ___wait_cond_timeout(condition, ret),		\
+		      TASK_INTERRUPTIBLE, 0, ret,			\
+		      ret = schedule_timeout(ret))
 
 /**
  * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses

  reply	other threads:[~2013-10-04 17:35 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02  9:22 [PATCH 00/16] sched/wait: Collapse __wait_event macros -v5 Peter Zijlstra
2013-10-02  9:22 ` [PATCH 01/16] sched/wait: Make the signal_pending() checks consistent Peter Zijlstra
2013-10-04 17:33   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 02/16] sched/wait: Change timeout logic Peter Zijlstra
2013-10-04 17:33   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 03/16] sched/wait: Change the wait_exclusive control flow Peter Zijlstra
2013-10-04 17:33   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 04/16] sched/wait: Introduce ___wait_event() Peter Zijlstra
2013-10-04 17:33   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 05/16] sched/wait: Collapse __wait_event() Peter Zijlstra
2013-10-04 17:34   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 06/16] sched/wait: Collapse __wait_event_timeout() Peter Zijlstra
2013-10-04 17:34   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 07/16] sched/wait: Collapse __wait_event_interruptible() Peter Zijlstra
2013-10-04 17:34   ` [tip:sched/core] sched/wait: Collapse __wait_event_interruptible( ) tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 08/16] sched/wait: Collapse __wait_event_interruptible_timeout() Peter Zijlstra
2013-10-04 17:34   ` tip-bot for Peter Zijlstra [this message]
2013-10-02  9:22 ` [PATCH 09/16] sched/wait: Collapse __wait_event_interruptible_exclusive() Peter Zijlstra
2013-10-04 17:34   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 10/16] sched/wait: Collapse __wait_event_lock_irq() Peter Zijlstra
2013-10-04 17:34   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 11/16] sched/wait: Collapse __wait_event_interruptible_lock_irq() Peter Zijlstra
2013-10-04 17:35   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 12/16] sched/wait: Collapse __wait_event_interruptible_lock_irq_timeout() Peter Zijlstra
2013-10-04 17:35   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 13/16] sched/wait: Collapse __wait_event_interruptible_tty() Peter Zijlstra
2013-10-04 17:35   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 14/16] sched/wait: Collapse __wait_event_killable() Peter Zijlstra
2013-10-04 17:35   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 15/16] sched/wait: Collapse __wait_event_hrtimeout() Peter Zijlstra
2013-10-04 17:35   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-02  9:22 ` [PATCH 16/16] sched/wait: Make the __wait_event*() interface more friendly Peter Zijlstra
2013-10-04 17:35   ` [tip:sched/core] " tip-bot for Peter Zijlstra
2013-10-04 20:44 ` [PATCH 00/16] sched/wait: Collapse __wait_event macros -v5 Peter Zijlstra
2013-10-04 20:44   ` Peter Zijlstra
2013-10-05  8:04     ` Ingo Molnar
2013-10-08  9:59       ` Peter Zijlstra
2013-10-08 10:23         ` Ingo Molnar
2013-10-08 14:16           ` Paul E. McKenney
2013-10-08 19:47             ` Ingo Molnar
2013-10-08 20:01               ` Peter Zijlstra
2013-10-08 20:41                 ` Paul E. McKenney
2013-10-08 21:06                   ` Peter Zijlstra
2013-10-08 21:43                     ` Paul E. McKenney
2013-10-08 20:40               ` Paul E. McKenney
2013-10-09  3:28                 ` Paul E. McKenney
2013-10-09  3:35                   ` Paul E. McKenney
2013-10-09  6:08                     ` Ingo Molnar
2013-10-09 14:21                       ` Paul E. McKenney
2013-10-10  2:59                         ` Paul E. McKenney
2013-10-10  8:05                           ` Ingo Molnar
2013-10-10 17:11                             ` Paul E. McKenney
2013-10-10 17:39                               ` Ingo Molnar
2013-10-10 18:58                                 ` Paul E. McKenney
2013-10-11  7:26                                   ` Ingo Molnar
2013-10-11 15:59                                     ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-c2ebb1fb4eddf3d1d66fe31d1e89e83ee211b81c@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.