Skip to content

Commit 268a3dc

Browse files
committed
Merge branch 'timers/range-hrtimers' into v28-range-hrtimers-for-linus-v2
Conflicts: kernel/time/tick-sched.c Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2 parents c4bd822 + 592aa99 commit 268a3dc

30 files changed

Lines changed: 710 additions & 379 deletions

File tree

‎arch/alpha/kernel/osf_sys.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -986,10 +986,12 @@ asmlinkage int
986986
osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
987987
struct timeval32 __user *tvp)
988988
{
989-
s64 timeout = MAX_SCHEDULE_TIMEOUT;
989+
struct timespec end_time, *to = NULL;
990990
if (tvp) {
991991
time_t sec, usec;
992992

993+
to = &end_time;
994+
993995
if (!access_ok(VERIFY_READ, tvp, sizeof(*tvp))
994996
|| __get_user(sec, &tvp->tv_sec)
995997
|| __get_user(usec, &tvp->tv_usec)) {
@@ -999,14 +1001,13 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
9991001
if (sec < 0 || usec < 0)
10001002
return -EINVAL;
10011003

1002-
if ((unsigned long) sec < MAX_SELECT_SECONDS) {
1003-
timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
1004-
timeout += sec * (unsigned long) HZ;
1005-
}
1004+
if (poll_select_set_timeout(to, sec, usec * NSEC_PER_USEC))
1005+
return -EINVAL;
1006+
10061007
}
10071008

10081009
/* OSF does not copy back the remaining time. */
1009-
return core_sys_select(n, inp, outp, exp, &timeout);
1010+
return core_sys_select(n, inp, outp, exp, to);
10101011
}
10111012

10121013
struct rusage32 {

‎arch/ia64/kvm/kvm-ia64.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ static void kvm_migrate_hlt_timer(struct kvm_vcpu *vcpu)
11141114
struct hrtimer *p_ht = &vcpu->arch.hlt_timer;
11151115

11161116
if (hrtimer_cancel(p_ht))
1117-
hrtimer_start(p_ht, p_ht->expires, HRTIMER_MODE_ABS);
1117+
hrtimer_start_expires(p_ht, HRTIMER_MODE_ABS);
11181118
}
11191119

11201120
static enum hrtimer_restart hlt_timer_fn(struct hrtimer *data)

‎arch/powerpc/oprofile/cell/spu_profiler.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ int start_spu_profiling(unsigned int cycles_reset)
196196
pr_debug("timer resolution: %lu\n", TICK_NSEC);
197197
kt = ktime_set(0, profiling_interval);
198198
hrtimer_init(&timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
199-
timer.expires = kt;
199+
hrtimer_set_expires(&timer, kt);
200200
timer.function = profile_spus;
201201

202202
/* Allocate arrays for collecting SPU PC samples */

‎arch/x86/kvm/i8254.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ static int __pit_timer_fn(struct kvm_kpit_state *ps)
204204
if (vcpu0 && waitqueue_active(&vcpu0->wq))
205205
wake_up_interruptible(&vcpu0->wq);
206206

207-
pt->timer.expires = ktime_add_ns(pt->timer.expires, pt->period);
208-
pt->scheduled = ktime_to_ns(pt->timer.expires);
207+
hrtimer_add_expires_ns(&pt->timer, pt->period);
208+
pt->scheduled = hrtimer_get_expires_ns(&pt->timer);
209209
if (pt->period)
210-
ps->channels[0].count_load_time = pt->timer.expires;
210+
ps->channels[0].count_load_time = hrtimer_get_expires(&pt->timer);
211211

212212
return (pt->period == 0 ? 0 : 1);
213213
}
@@ -257,7 +257,7 @@ void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)
257257

258258
timer = &pit->pit_state.pit_timer.timer;
259259
if (hrtimer_cancel(timer))
260-
hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS);
260+
hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
261261
}
262262

263263
static void destroy_pit_timer(struct kvm_kpit_timer *pt)

‎arch/x86/kvm/lapic.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,7 @@ static int __apic_timer_fn(struct kvm_lapic *apic)
946946

947947
if (apic_lvtt_period(apic)) {
948948
result = 1;
949-
apic->timer.dev.expires = ktime_add_ns(
950-
apic->timer.dev.expires,
951-
apic->timer.period);
949+
hrtimer_add_expires_ns(&apic->timer.dev, apic->timer.period);
952950
}
953951
return result;
954952
}
@@ -1117,7 +1115,7 @@ void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu)
11171115

11181116
timer = &apic->timer.dev;
11191117
if (hrtimer_cancel(timer))
1120-
hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS);
1118+
hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
11211119
}
11221120

11231121
void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu)

‎drivers/cpuidle/cpuidle.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/cpu.h>
1717
#include <linux/cpuidle.h>
1818
#include <linux/ktime.h>
19+
#include <linux/hrtimer.h>
1920

2021
#include "cpuidle.h"
2122

@@ -60,6 +61,12 @@ static void cpuidle_idle_call(void)
6061
return;
6162
}
6263

64+
/*
65+
* run any timers that can be run now, at this point
66+
* before calculating the idle duration etc.
67+
*/
68+
hrtimer_peek_ahead_timers();
69+
6370
/* ask the governor for the next state */
6471
next_state = cpuidle_curr_governor->select(dev);
6572
if (need_resched())

‎drivers/s390/crypto/ap_bus.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,9 @@ static ssize_t poll_timeout_store(struct bus_type *bus, const char *buf,
659659
hr_time = ktime_set(0, poll_timeout);
660660

661661
if (!hrtimer_is_queued(&ap_poll_timer) ||
662-
!hrtimer_forward(&ap_poll_timer, ap_poll_timer.expires, hr_time)) {
663-
ap_poll_timer.expires = hr_time;
664-
hrtimer_start(&ap_poll_timer, hr_time, HRTIMER_MODE_ABS);
662+
!hrtimer_forward(&ap_poll_timer, hrtimer_get_expires(&ap_poll_timer), hr_time)) {
663+
hrtimer_set_expires(&ap_poll_timer, hr_time);
664+
hrtimer_start_expires(&ap_poll_timer, HRTIMER_MODE_ABS);
665665
}
666666
return count;
667667
}

0 commit comments

Comments
 (0)