lkml.org 
[lkml]   [2017]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] tick: Make sure tick timer is active when bypassing reprogramming
On Thu, Apr 20, 2017 at 09:40:12PM +0200, Thomas Gleixner wrote:
> On Thu, 20 Apr 2017, Frederic Weisbecker wrote:
> > On Thu, Apr 20, 2017 at 07:56:22PM +0200, Thomas Gleixner wrote:
> > > > /* Skip reprogram of event if its not changed */
> > > > - if (ts->tick_stopped && (expires == ts->next_tick))
> > > > + if (ts->tick_stopped && (expires == ts->next_tick)) {
> > > > + WARN_ON_ONCE(dev->next_event > ts->next_tick);
> > >
> > > What about handling it proper ? dev->next_event might be KTIME_MAX,
> > > i.e. no more event for the next 500+ years.
> >
> > I thought I handled this case, what I'm I missing?
>
> if (ts->tick_stopped && (expires == ts->next_tick)) {
> WARN_ON_ONCE(dev->next_event > ts->next_tick);
> goto out;
> }
>
> IOW, the WARN_ON yells in dmesg, but despite seing the wreckage it just
> leaves it and goes out doing nothing.
>
> Why can't you just do
>
> if (ts->tick_stopped && (expires == ts->next_tick)) {
> if (dev->next_event > ts->next_tick)) {
> WARN_ONCE();
> do_something_sensible();
> }
> goto out;
> }
>
> Hmm?

Ah ok, right!

So something like this:

if (ts->tick_stopped && (expires == ts->next_tick)) {
if (likely(dev->next_event <= ts->next_tick))
goto out;
WARN_ON_ONCE(1);
}

So that we fall down to clock reprogramming if the sanity check fails.

I'm resending the patches.

Thanks.

\
 
 \ /
  Last update: 2017-04-21 01:28    [W:0.066 / U:8.804 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site