summaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-08 17:58:59 +0200
committerArjan van de Ven <arjan@linux.intel.com>2008-09-11 16:16:55 +0200
commit3bd012060f962567aadb52b27b2fc8fdc91102c7 (patch)
tree304f42afb3131c785b0b5c224e93a1e31a0b00c8 /kernel/hrtimer.c
parenthrtimer: fix signed/unsigned bug in slack estimator (diff)
downloadlinux-3bd012060f962567aadb52b27b2fc8fdc91102c7.tar.xz
linux-3bd012060f962567aadb52b27b2fc8fdc91102c7.zip
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>
Diffstat (limited to '')
-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,
struct restart_block *restart;
struct hrtimer_sleeper t;
int ret = 0;
+ unsigned long slack;
+
+ slack = current->timer_slack_ns;
+ if (rt_task(current))
+ slack = 0;
hrtimer_init_on_stack(&t.timer, clockid, mode);
- hrtimer_set_expires(&t.timer, timespec_to_ktime(*rqtp));
+ hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack);
if (do_nanosleep(&t, mode))
goto out;