Commit ebdc195f authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched/wait: Collapse __wait_event_hrtimeout()

While not a whole-sale replacement like the others we can still reduce
the size of __wait_event_hrtimeout() considerably by noting that the
actual core of __wait_event_hrtimeout() is identical to what
___wait_event() generates.
Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131002092528.972793648@infradead.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent cf7361fd
...@@ -337,7 +337,6 @@ do { \ ...@@ -337,7 +337,6 @@ do { \
#define __wait_event_hrtimeout(wq, condition, timeout, state) \ #define __wait_event_hrtimeout(wq, condition, timeout, state) \
({ \ ({ \
int __ret = 0; \ int __ret = 0; \
DEFINE_WAIT(__wait); \
struct hrtimer_sleeper __t; \ struct hrtimer_sleeper __t; \
\ \
hrtimer_init_on_stack(&__t.timer, CLOCK_MONOTONIC, \ hrtimer_init_on_stack(&__t.timer, CLOCK_MONOTONIC, \
...@@ -348,25 +347,15 @@ do { \ ...@@ -348,25 +347,15 @@ do { \
current->timer_slack_ns, \ current->timer_slack_ns, \
HRTIMER_MODE_REL); \ HRTIMER_MODE_REL); \
\ \
for (;;) { \ ___wait_event(wq, condition, state, 0, __ret, \
prepare_to_wait(&wq, &__wait, state); \
if (condition) \
break; \
if (state == TASK_INTERRUPTIBLE && \
signal_pending(current)) { \
__ret = -ERESTARTSYS; \
break; \
} \
if (!__t.task) { \ if (!__t.task) { \
__ret = -ETIME; \ __ret = -ETIME; \
break; \ break; \
} \ } \
schedule(); \ schedule()); \
} \
\ \
hrtimer_cancel(&__t.timer); \ hrtimer_cancel(&__t.timer); \
destroy_hrtimer_on_stack(&__t.timer); \ destroy_hrtimer_on_stack(&__t.timer); \
finish_wait(&wq, &__wait); \
__ret; \ __ret; \
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment