aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-08 11:58:59 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-09-11 10:16:55 -0400
commit3bd012060f962567aadb52b27b2fc8fdc91102c7 (patch)
tree304f42afb3131c785b0b5c224e93a1e31a0b00c8
parent96d2ab484e7a9bafdab44b8c7d1ef5944319b18c (diff)
hrtimer: make the nanosleep() syscall use the per process slack
This patch makes the nanosleep() 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>
-rw-r--r--kernel/hrtimer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index a0222097c57e..9a4c90185566 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1563,9 +1563,14 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
1563 struct restart_block *restart; 1563 struct restart_block *restart;
1564 struct hrtimer_sleeper t; 1564 struct hrtimer_sleeper t;
1565 int ret = 0; 1565 int ret = 0;
1566 unsigned long slack;
1567
1568 slack = current->timer_slack_ns;
1569 if (rt_task(current))
1570 slack = 0;
1566 1571
1567 hrtimer_init_on_stack(&t.timer, clockid, mode); 1572 hrtimer_init_on_stack(&t.timer, clockid, mode);
1568 hrtimer_set_expires(&t.timer, timespec_to_ktime(*rqtp)); 1573 hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack);
1569 if (do_nanosleep(&t, mode)) 1574 if (do_nanosleep(&t, mode))
1570 goto out; 1575 goto out;
1571 1576