Re: [patch 6/13] signal/timer/event fds v9 - timerfd core ...



On Mon, 2007-04-02 at 10:30 -0700, Davide Libenzi wrote:

There is no inaccuracy when you rearm the timer on read: hrtimer_forward
takes care, that the period is accurate. It does not start the timer out
of the periodic order, i.e. on a different time frame.

Where is the win of keeping the timer running, when nobody cares about
the expiry at all ? It just generates interrupts and events for nothing.

Then you'd lose the ability to know if you lost one or more (yes, you
could figure it out by reading the time and with a few calculations). I
think that the capping (to a sane value) idea solves the DoS issue and at
the same time have the ability to report you missed ticks. What are your
strong points against that solution?

Err, the read function

ticks = hrtimer_forward(&ctx->tmr, ktime_get(),
ctx->tintv);

does give you the number of (lost) ticks.

tmr->expires holds the absolute expiry time of the last event.
hrtimer_forward() adds N intervals to tmr->expires, so that the new
tmr->expires value is greater than now (ktime_get()). It returns N.

So the number of lost ticks is N - 1. No time reading and no magic
math :)

tglx


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [patch 6/13] signal/timer/event fds v9 - timerfd core ...
    ... takes care, ... of the periodic order, i.e. on a different time frame. ... Where is the win of keeping the timer running, ... the same time have the ability to report you missed ticks. ...
    (Linux-Kernel)
  • Re: After specified browser activity
    ... When the page loads a "timer" ... starts counting seconds. ... When it reaches zero, ... It does NOT care about activity. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: After specified browser activity
    ... When the page loads a "timer" ... starts counting seconds. ... When it reaches zero, ... It does NOT care about activity. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: jiffies wraparound
    ... problem when the timer wraps. ... before the wrap. ... half the period of the jiffy counter.) ... > * wouldn't care). ...
    (comp.os.linux.development.system)
  • Re: [patch 6/13] signal/timer/event fds v9 - timerfd core ...
    ... takes care, ... of the periodic order, i.e. on a different time frame. ... Where is the win of keeping the timer running, ... Then you'd lose the ability to know if you lost one or more (yes, ...
    (Linux-Kernel)