Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1520227

Re: [PATCH] timers: Fix timer inaccuracy

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] timers: Fix timer inaccuracy
Date 2016-11-12 12:30 +0100
Message-ID <sCEFr-1nk-7@gated-at.bofh.it> (permalink)
References <sBxwl-5sn-1@gated-at.bofh.it> <sBxPI-5yX-9@gated-at.bofh.it> <sBMvn-7aj-7@gated-at.bofh.it> <sBUCC-4lx-29@gated-at.bofh.it> <sCvLQ-3Qh-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 11 Nov 2016, Saravana Kannan wrote:
> On 11/10/2016 02:07 AM, Thomas Gleixner wrote:
> > Deferrable timers shouldn't have been invented in the first place and yes,
> > they are not going to happen on hrtimers, quite the contrary, I'm working
> > on eliminating them completely.
> 
> If you do that, how exactly do you propose drivers do periodic polling while
> the Linux isn't idling, but stop polling when Linux is idle? devfreq is a
> classic example. devfreq is used in a lot of mobile devices. Across different
> vendors, devfreq is used for scaling system memory, flash storage, GPU, etc.
> You are going to kill power if you remove deferrable timers without having an
> alternate mechanism to solve this requirement.
> 
> For example, when you are browsing on your phone and reading something on
> screen (but not interacting with the device), the CPUs/clusters/caches go idle
> for long periods (several seconds) of time. If you remove deferrable timers,
> you are going to force a CPU wake up every 10ms or 50ms or whatever it's
> configured for.

I know how all that works, but there are other ways to deal with those
timers. We had complaints in the past because those timers can be stuck
forever on a fully idle cpu and that's not a good thing either. The whole
concept is ill defined or not defined at all, lacks any form of sane
semantics and was shoved into the kernel w/i much thought. In hindsight I
should have rejected that deferrable mess 5+ years ago.
 
> > When you can come up with a real regression caused by the rework and not
> > just some handwaving theories then we can revisit that, but until then it's
> > going to stay as is.
> 
> If the polling interval isn't accurate, the regression isn't so much about the
> timer being inaccurate, but more so in the fact that it'll take that much
> longer to react and increase the device frequency. Frame rendering time is
> 16ms. If you react after 20ms instead of 10ms, that's way past a frame
> rendering time. System memory frequency matters a lot for frame rendering too.

If you need precise timers use hrtimers and not a tick based mechanism,
it's that simple.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] timers: Fix timer inaccuracy Joonwoo Park <joonwoop@codeaurora.org> - 2016-11-09 10:40 +0100
  Re: [PATCH] timers: Fix timer inaccuracy Thomas Gleixner <tglx@linutronix.de> - 2016-11-09 11:00 +0100
    Re: [PATCH] timers: Fix timer inaccuracy Joonwoo Park <joonwoop@codeaurora.org> - 2016-11-10 02:40 +0100
      Re: [PATCH] timers: Fix timer inaccuracy Thomas Gleixner <tglx@linutronix.de> - 2016-11-10 11:20 +0100
        Re: [PATCH] timers: Fix timer inaccuracy Saravana Kannan <skannan@codeaurora.org> - 2016-11-12 03:00 +0100
          Re: [PATCH] timers: Fix timer inaccuracy Thomas Gleixner <tglx@linutronix.de> - 2016-11-12 12:30 +0100
            Re: [PATCH] timers: Fix timer inaccuracy skannan@codeaurora.org - 2016-11-14 00:30 +0100

csiph-web