Message ID | 1375998147-24292-6-git-send-email-alex@alex.org.uk |
---|---|
State | New |
Headers | show |
On Thu, Aug 08, 2013 at 10:42:02PM +0100, Alex Bligh wrote: > Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to > set one nanosecond timer slack to increase precision of timer > calls. > > Signed-off-by: Alex Bligh <alex@alex.org.uk> > --- > qemu-timer.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/qemu-timer.c b/qemu-timer.c > index 5e81935..9eb6db8 100644 > --- a/qemu-timer.c > +++ b/qemu-timer.c > @@ -41,6 +41,10 @@ > #include <poll.h> > #endif > > +#ifdef CONFIG_PRCTL_PR_SET_TIMERSLACK The ./configure change should also be in this patch. I think it crept into another patch by mistake.
On 9 Aug 2013, at 09:53, Stefan Hajnoczi wrote: > The ./configure change should also be in this patch. I think it crept > into another patch by mistake. Oops - I will fix.
diff --git a/qemu-timer.c b/qemu-timer.c index 5e81935..9eb6db8 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -41,6 +41,10 @@ #include <poll.h> #endif +#ifdef CONFIG_PRCTL_PR_SET_TIMERSLACK +#include <sys/prctl.h> +#endif + /***********************************************************/ /* timers */ @@ -507,6 +511,9 @@ void init_clocks(void) vm_clock = qemu_clock_new(QEMU_CLOCK_VIRTUAL); host_clock = qemu_clock_new(QEMU_CLOCK_HOST); } +#ifdef CONFIG_PRCTL_PR_SET_TIMERSLACK + prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); +#endif } uint64_t qemu_timer_expire_time_ns(QEMUTimer *ts)
Where supported, called prctl(PR_SET_TIMERSLACK, 1, ...) to set one nanosecond timer slack to increase precision of timer calls. Signed-off-by: Alex Bligh <alex@alex.org.uk> --- qemu-timer.c | 7 +++++++ 1 file changed, 7 insertions(+)