Skip to content

Commit

Permalink
hrtimer: make the nanosleep() syscall use the per process slack
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arjan van de Ven committed Sep 11, 2008
1 parent 96d2ab4 commit 3bd0120
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3bd0120

Please sign in to comment.