From: Davide Libenzi <davidel@xmailserver.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [patch 6/13] signal/timer/event fds v9 - timerfd core ...
Date: Mon, 2 Apr 2007 10:52:56 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0704021052070.26489@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <1175536065.28263.177.camel@localhost.localdomain>
On Mon, 2 Apr 2007, Thomas Gleixner wrote:
> 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 :)
Yack, I missed that part :) Sounds fine then.
- Davide
prev parent reply other threads:[~2007-04-02 17:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-31 20:09 Davide Libenzi
2007-04-01 9:05 ` Thomas Gleixner
2007-04-01 17:00 ` Davide Libenzi
2007-04-01 17:08 ` Davide Libenzi
2007-04-02 7:22 ` Thomas Gleixner
2007-04-02 17:30 ` Davide Libenzi
2007-04-02 17:47 ` Thomas Gleixner
2007-04-02 17:52 ` Davide Libenzi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0704021052070.26489@alien.or.mcafeemobile.com \
--to=davidel@xmailserver.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®