diff options
Diffstat (limited to 'kernel/time/hrtimer.c')
-rw-r--r-- | kernel/time/hrtimer.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index a6d5b061ee67..0cc8ab474d4a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c | |||
@@ -1622,6 +1622,19 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp, | |||
1622 | if (dl_task(current) || rt_task(current) || is_realtime(current)) | 1622 | if (dl_task(current) || rt_task(current) || is_realtime(current)) |
1623 | slack = 0; | 1623 | slack = 0; |
1624 | 1624 | ||
1625 | if (is_realtime(current) | ||
1626 | && clockid == CLOCK_MONOTONIC | ||
1627 | && mode == HRTIMER_MODE_ABS) { | ||
1628 | /* special handling: to handle periodic activations | ||
1629 | * correctly despite timer interrupt jitter and overheads, | ||
1630 | * the plugin might need to know the time at which the | ||
1631 | * task intends to wake up | ||
1632 | */ | ||
1633 | tsk_rt(current)->doing_abs_nanosleep = 1; | ||
1634 | tsk_rt(current)->nanosleep_wakeup = | ||
1635 | ktime_to_ns(timespec_to_ktime(*rqtp)); | ||
1636 | } | ||
1637 | |||
1625 | hrtimer_init_on_stack(&t.timer, clockid, mode); | 1638 | hrtimer_init_on_stack(&t.timer, clockid, mode); |
1626 | hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack); | 1639 | hrtimer_set_expires_range_ns(&t.timer, timespec_to_ktime(*rqtp), slack); |
1627 | if (do_nanosleep(&t, mode)) | 1640 | if (do_nanosleep(&t, mode)) |
@@ -1648,6 +1661,9 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp, | |||
1648 | ret = -ERESTART_RESTARTBLOCK; | 1661 | ret = -ERESTART_RESTARTBLOCK; |
1649 | out: | 1662 | out: |
1650 | destroy_hrtimer_on_stack(&t.timer); | 1663 | destroy_hrtimer_on_stack(&t.timer); |
1664 | |||
1665 | tsk_rt(current)->doing_abs_nanosleep = 0; | ||
1666 | |||
1651 | return ret; | 1667 | return ret; |
1652 | } | 1668 | } |
1653 | 1669 | ||