aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/futex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/futex.c')
-rw-r--r--kernel/futex.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 62cbd648e28a..e10c5c8786a6 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1229,13 +1229,16 @@ static int futex_wait(u32 __user *uaddr, int fshared,
1229 if (!abs_time) 1229 if (!abs_time)
1230 schedule(); 1230 schedule();
1231 else { 1231 else {
1232 unsigned long slack;
1233 slack = current->timer_slack_ns;
1234 if (rt_task(current))
1235 slack = 0;
1232 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, 1236 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC,
1233 HRTIMER_MODE_ABS); 1237 HRTIMER_MODE_ABS);
1234 hrtimer_init_sleeper(&t, current); 1238 hrtimer_init_sleeper(&t, current);
1235 t.timer.expires = *abs_time; 1239 hrtimer_set_expires_range_ns(&t.timer, *abs_time, slack);
1236 1240
1237 hrtimer_start(&t.timer, t.timer.expires, 1241 hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
1238 HRTIMER_MODE_ABS);
1239 if (!hrtimer_active(&t.timer)) 1242 if (!hrtimer_active(&t.timer))
1240 t.task = NULL; 1243 t.task = NULL;
1241 1244
@@ -1337,7 +1340,7 @@ static int futex_lock_pi(u32 __user *uaddr, int fshared,
1337 hrtimer_init_on_stack(&to->timer, CLOCK_REALTIME, 1340 hrtimer_init_on_stack(&to->timer, CLOCK_REALTIME,
1338 HRTIMER_MODE_ABS); 1341 HRTIMER_MODE_ABS);
1339 hrtimer_init_sleeper(to, current); 1342 hrtimer_init_sleeper(to, current);
1340 to->timer.expires = *time; 1343 hrtimer_set_expires(&to->timer, *time);
1341 } 1344 }
1342 1345
1343 q.pi_state = NULL; 1346 q.pi_state = NULL;