Commit ae4b748e81b7e366f04f55229d5e372e372c33af

Authored by Arjan van de Ven
1 parent 3bd012060f

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>

Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff

... ... @@ -1296,10 +1296,14 @@
1296 1296 if (!abs_time)
1297 1297 schedule();
1298 1298 else {
  1299 + unsigned long slack;
  1300 + slack = current->timer_slack_ns;
  1301 + if (rt_task(current))
  1302 + slack = 0;
1299 1303 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC,
1300 1304 HRTIMER_MODE_ABS);
1301 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 1308 hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
1305 1309 if (!hrtimer_active(&t.timer))