mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-25 08:34:31 +00:00
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>
This commit is contained in:
parent
3bd012060f
commit
ae4b748e81
1 changed files with 5 additions and 1 deletions
|
@ -1296,10 +1296,14 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared,
|
||||||
if (!abs_time)
|
if (!abs_time)
|
||||||
schedule();
|
schedule();
|
||||||
else {
|
else {
|
||||||
|
unsigned long slack;
|
||||||
|
slack = current->timer_slack_ns;
|
||||||
|
if (rt_task(current))
|
||||||
|
slack = 0;
|
||||||
hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC,
|
hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC,
|
||||||
HRTIMER_MODE_ABS);
|
HRTIMER_MODE_ABS);
|
||||||
hrtimer_init_sleeper(&t, current);
|
hrtimer_init_sleeper(&t, current);
|
||||||
hrtimer_set_expires(&t.timer, *abs_time);
|
hrtimer_set_expires_range_ns(&t.timer, *abs_time, slack);
|
||||||
|
|
||||||
hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
|
hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
|
||||||
if (!hrtimer_active(&t.timer))
|
if (!hrtimer_active(&t.timer))
|
||||||
|
|
Loading…
Add table
Reference in a new issue