Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1347974 > unrolled thread
| Started by | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| First post | 2016-03-02 12:40 +0100 |
| Last post | 2016-03-03 11:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [tip:timers/core] hrtimer: Add support for CLOCK_MONOTONIC_RAW Marc Zyngier <marc.zyngier@arm.com> - 2016-03-02 12:40 +0100
[tip:timers/core] hrtimer: Revert CLOCK_MONOTONIC_RAW support tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2016-03-03 11:30 +0100
| From | Marc Zyngier <marc.zyngier@arm.com> |
|---|---|
| Date | 2016-03-02 12:40 +0100 |
| Subject | Re: [tip:timers/core] hrtimer: Add support for CLOCK_MONOTONIC_RAW |
| Message-ID | <r8dii-6Yi-17@gated-at.bofh.it> |
Thomas,
On 27/01/16 11:42, tip-bot for Marc Zyngier wrote:
> Commit-ID: 9c808765e88efb6fa6af7e2206ef89512f1840a7
> Gitweb: http://git.kernel.org/tip/9c808765e88efb6fa6af7e2206ef89512f1840a7
> Author: Marc Zyngier <marc.zyngier@arm.com>
> AuthorDate: Fri, 15 Jan 2016 17:41:08 +0000
> Committer: Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Wed, 27 Jan 2016 12:38:04 +0100
>
> hrtimer: Add support for CLOCK_MONOTONIC_RAW
>
> The KVM/ARM timer implementation arms a hrtimer when a vcpu is
> blocked (usually because it is waiting for an interrupt)
> while its timer is going to kick in the future.
>
> It is essential that this timer doesn't get adjusted, or the
> guest will end up being woken-up at the wrong time (NTP running
> on the host seems to confuse the hell out of some guests).
>
> In order to allow this, let's add CLOCK_MONOTONIC_RAW support
> to hrtimer (it is so far only supported for posix timers). It also
> has the (limited) benefit of fixing de0421d53bfb ("mac80211_hwsim:
> shuffle code to prepare for dynamic radios"), which already uses
> this functionnality without realizing wasn't implemented (just being
> lucky...).
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Tomasz Nowicki <tn@semihalf.com>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Link: http://lkml.kernel.org/r/1452879670-16133-2-git-send-email-marc.zyngier@arm.com
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
I'm afraid this patch is terminally broken - I managed to make this fall
over pretty easily (hint to self: __hrtimer_get_next_event needs some
serious thoughts to deal with MONOTONIC_RAW, and so does hrtimer_forward
at the very least).
Can you please drop (or revert):
a6e707d KVM: arm/arm64: timer: Switch to CLOCK_MONOTONIC_RAW
9006a01 hrtimer: Catch illegal clockids
9c80876 hrtimer: Add support for CLOCK_MONOTONIC_RAW
Thanks, and sorry for the noise.
M.
--
Jazz is not dead. It just smells funny...
[toc] | [next] | [standalone]
| From | tip-bot for Thomas Gleixner <tipbot@zytor.com> |
|---|---|
| Date | 2016-03-03 11:30 +0100 |
| Subject | [tip:timers/core] hrtimer: Revert CLOCK_MONOTONIC_RAW support |
| Message-ID | <r8yG6-5Ai-5@gated-at.bofh.it> |
| In reply to | #1347974 |
Commit-ID: 82e88ff1ea948d83125a8aaa7c9809f03ccc500f
Gitweb: http://git.kernel.org/tip/82e88ff1ea948d83125a8aaa7c9809f03ccc500f
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Thu, 3 Mar 2016 11:11:12 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 3 Mar 2016 11:11:12 +0100
hrtimer: Revert CLOCK_MONOTONIC_RAW support
Revert commits:
a6e707ddbdf1: KVM: arm/arm64: timer: Switch to CLOCK_MONOTONIC_RAW
9006a01829a5: hrtimer: Catch illegal clockids
9c808765e88e: hrtimer: Add support for CLOCK_MONOTONIC_RAW
Marc found out, that there are fundamental issues with that patch series
because __hrtimer_get_next_event() and hrtimer_forward() need support for
CLOCK_MONOTONIC_RAW. Nothing which is easily fixed, so revert the whole lot.
Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/56D6CEF0.8060607@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/hrtimer.h | 1 -
kernel/time/hrtimer.c | 18 ++----------------
virt/kvm/arm/arch_timer.c | 4 ++--
3 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index a6d64af..76dd4f0 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -151,7 +151,6 @@ enum hrtimer_base_type {
HRTIMER_BASE_REALTIME,
HRTIMER_BASE_BOOTTIME,
HRTIMER_BASE_TAI,
- HRTIMER_BASE_MONOTONIC_RAW,
HRTIMER_MAX_CLOCK_BASES,
};
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index cb0fe70..435b885 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -90,30 +90,19 @@ DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
.clockid = CLOCK_TAI,
.get_time = &ktime_get_clocktai,
},
- {
- .index = HRTIMER_BASE_MONOTONIC_RAW,
- .clockid = CLOCK_MONOTONIC_RAW,
- .get_time = &ktime_get_raw,
- },
}
};
static const int hrtimer_clock_to_base_table[MAX_CLOCKS] = {
- /* Make sure we catch unsupported clockids */
- [0 ... MAX_CLOCKS - 1] = HRTIMER_MAX_CLOCK_BASES,
-
[CLOCK_REALTIME] = HRTIMER_BASE_REALTIME,
[CLOCK_MONOTONIC] = HRTIMER_BASE_MONOTONIC,
- [CLOCK_MONOTONIC_RAW] = HRTIMER_BASE_MONOTONIC_RAW,
[CLOCK_BOOTTIME] = HRTIMER_BASE_BOOTTIME,
[CLOCK_TAI] = HRTIMER_BASE_TAI,
};
static inline int hrtimer_clockid_to_base(clockid_t clock_id)
{
- int base = hrtimer_clock_to_base_table[clock_id];
- BUG_ON(base == HRTIMER_MAX_CLOCK_BASES);
- return base;
+ return hrtimer_clock_to_base_table[clock_id];
}
/*
@@ -1279,10 +1268,7 @@ static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now)
if (!(active & 0x01))
continue;
- if (unlikely(base->index == HRTIMER_BASE_MONOTONIC_RAW))
- basenow = ktime_get_raw();
- else
- basenow = ktime_add(now, base->offset);
+ basenow = ktime_add(now, base->offset);
while ((node = timerqueue_getnext(&base->active))) {
struct hrtimer *timer;
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
index 97c5815..69bca18 100644
--- a/virt/kvm/arm/arch_timer.c
+++ b/virt/kvm/arm/arch_timer.c
@@ -48,7 +48,7 @@ static bool timer_is_armed(struct arch_timer_cpu *timer)
static void timer_arm(struct arch_timer_cpu *timer, u64 ns)
{
timer->armed = true;
- hrtimer_start(&timer->timer, ktime_add_ns(ktime_get_raw(), ns),
+ hrtimer_start(&timer->timer, ktime_add_ns(ktime_get(), ns),
HRTIMER_MODE_ABS);
}
@@ -308,7 +308,7 @@ void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu)
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
INIT_WORK(&timer->expired, kvm_timer_inject_irq_work);
- hrtimer_init(&timer->timer, CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
+ hrtimer_init(&timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
timer->timer.function = kvm_timer_expire;
}
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web