aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/futex.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-08 12:03:57 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-09-11 10:17:00 -0400
commitae4b748e81b7e366f04f55229d5e372e372c33af (patch)
tree27ce1d7a205df69c79bbdd35fc721401d79a13cb /kernel/futex.c
parent3bd012060f962567aadb52b27b2fc8fdc91102c7 (diff)
hrtimer: make the futex() system call use the per process slack value
This patch makes the futex() system call use the per process slack value; with this users are able to externally control existing applications to reduce the wakeup rate. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r--kernel/futex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 4cd5b4319b04..8af10027514b 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1296,10 +1296,14 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared,
1296 if (!abs_time) 1296 if (!abs_time)
1297 schedule(); 1297 schedule();
1298 else { 1298 else {
1299 unsigned long slack;
1300 slack = current->timer_slack_ns;
1301 if (rt_task(current))
1302 slack = 0;
1299 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, 1303 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC,
1300 HRTIMER_MODE_ABS); 1304 HRTIMER_MODE_ABS);
1301 hrtimer_init_sleeper(&t, current); 1305 hrtimer_init_sleeper(&t, current);
1302 hrtimer_set_expires(&t.timer, *abs_time); 1306 hrtimer_set_expires_range_ns(&t.timer, *abs_time, slack);
1303 1307
1304 hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS); 1308 hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
1305 if (!hrtimer_active(&t.timer)) 1309 if (!hrtimer_active(&t.timer))