linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venki Pallipadi <venkatesh.pallipadi@intel.com>
To: Pavel Machek <pavel@suse.cz>
Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"arjan@infradead.org" <arjan@infradead.org>
Subject: Re: [RFC] Imprecise timers.
Date: Tue, 12 Aug 2008 11:11:27 -0700	[thread overview]
Message-ID: <20080812181126.GA30061@linux-os.sc.intel.com> (raw)
In-Reply-To: <20080812120031.GD8806@elf.ucw.cz>

On Tue, Aug 12, 2008 at 05:00:31AM -0700, Pavel Machek wrote:
> Hi!
> 
> > > > >which will run some time later when the CPU happens to be awake. And a
> > > > >non-deferrable timer at the hard deadline, to ensure it really does
> > > > >happen by then.
> > > > >
> > > >
> > > > One concern I have is drivers using range_timers thinking that they need
> > > > some upper bound, while all they need is a simple deferrable timer. With that
> > > > we will have multiple timers waking up the CPU all the time (say, on
> > > > different CPUs) problem again. Even without the timers waking up all
> > >
> > > I don't get it. Who has timers that can be deferred forever? At that
> > > point they may simply not set the timer at all, right?
> > >
> >
> > I don't think I said drivers have or need timers that can be deferred forever.
> >
> > My point is, is it worth the overhead of setting and deleting additional timer,
> > just because drivers think that they need to use this new interface,
> > need to set a upper bound and come up with random upper bounds.
> > Apart from the overhead of setup and teardown we will somewhat negate the
> > benefits of deferrable timers as the upper bound hard timers can fire at
> > different times waking up the CPUs frequently.
> 
> > I understand that some drivers need this kind of upper limit. I am not sure
> > whether all drivers need it and if not, how can we restrict drivers from using
> > this when they don't really need it.
> 
> Do you have example of driver that does NOT need upper limit?
> 
> Like... lets take ATA.
> 
> submit_command()
> if command is not back in ~5 seconds, it probably timed out.
> 
> So you set soft limit to 5 seconds, and hard limit to 10. You
> definitely want user to know something is wrong after 10 seconds,
> right?
> 

I would say this will be the wrong usage of deadline, atleast with the
two timer and no round off implementation.

For this example, it will probably be better to use round_jiffies to round the
timer to second level and make it go in sync with all other round timers on
this CPU, rather than setting two timers with hard timer not in sync with
other timers on the CPU.

- if there are other timers (rounded or otherwise) on this CPU that goes off
between 5-10 seconds, we are paying penalty for setting up and removing one
extra timer with no obvious benefit.
- if there are no other timers on this CPU, that goes off between 5-10 seconds,
timer after 10 seconds will not be in sync with other potential round timers
on this CPU that may go off between 10-11 seconds, causing one extra wakeup
and again the overhead of setting up and removing one extra timer.

Instead a rounded timer after 5 seconds still ensures atleast 1s idle time on
the CPU without the overhead.

There can be many users who really don't care about the deadline or can happliy
use rounded timers or deferrable timers. Say garbage collectors, cache_reap
and friends, ondemand governor, vga cursor blinking comes to my mind.

Thanks,
Venki



  reply	other threads:[~2008-08-12 18:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22  3:02 [RFC] Imprecise timers David Woodhouse
2008-07-22  3:05 ` [RFC] schedule_timeout_range() David Woodhouse
2008-07-22  3:56   ` Nick Piggin
2008-07-22  4:12     ` David Woodhouse
2008-07-22  4:26       ` Arjan van de Ven
2008-07-22  4:34         ` David Woodhouse
2008-07-22  4:33       ` Nick Piggin
2008-07-22  4:45         ` David Woodhouse
2008-07-22  4:50           ` Nick Piggin
2008-07-22  4:58             ` David Woodhouse
2008-07-22  5:35               ` Jan Engelhardt
2008-07-22  4:33     ` Arjan van de Ven
2008-07-22  7:19 ` [RFC] Imprecise timers Rene Herman
2008-07-22 12:54   ` Arjan van de Ven
2008-07-22 14:04     ` Rene Herman
2008-07-29  0:36 ` Pallipadi, Venkatesh
2008-08-09 12:54   ` Pavel Machek
2008-08-11 17:35     ` Venki Pallipadi
2008-08-12 12:00       ` Pavel Machek
2008-08-12 18:11         ` Venki Pallipadi [this message]
2008-08-12 21:55           ` Alan Cox
2008-08-12 21:58           ` Pavel Machek

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=20080812181126.GA30061@linux-os.sc.intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=arjan@infradead.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pavel@suse.cz \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).