mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Aniroop Mathur <aniroop.mathur@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>,
	a.mathur@samsung.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Ques: [kernel/time/*] Is there any disadvantage in using sleep_range for more than 20ms delay ?
Date: Tue, 8 Dec 2015 11:48:39 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1512081147050.3595@nanos> (raw)
In-Reply-To: <CADYu30_jX=RrQ-Zy7Q6NjDcr7oyZpByptfLEYVkObasMeRjjHg@mail.gmail.com>

On Tue, 8 Dec 2015, Aniroop Mathur wrote:
> On Tue, Dec 8, 2015 at 12:07 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > The real question is how precise must your delay be? If the delay
> > needs to be precise within the min/max sleep time limits, then
> > usleep_range() is probably the way to go. If the delay can be
> > imprecise then using msleep() is the right way because that lets the
> > kernel batch timers for power saving purposes.
>
> Thank you for the answer !
> Normally, we insert delays in driver while enabling the chip.
> So here usleep_range seems to service better as we do not want to delay
> the initialisation process of chip and make it ready to generate data,
> especially for faster devices like sensor.

The initialization process is hardly something critical, so why would
the delay need to be precise? What's the point of having data 10ms
earlier?
 
> One last thing,
> Considering HZ=100, would the power saving be same if we set the
> range in usleep_range equivalent to msleep ?
> For example: msleep (33) and usleep_range(33000, 40000)
> So for such case, would both have same impact on power saving ?

Probably, but what's the point of doing that?

Thanks,

	tglx

  reply	other threads:[~2015-12-08 10:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 17:50 Aniroop Mathur
2015-12-07 18:37 ` Thomas Gleixner
2015-12-08  2:45   ` Aniroop Mathur
2015-12-08 10:48     ` Thomas Gleixner [this message]
2015-12-08 15:35       ` Aniroop Mathur
2015-12-08 20:47         ` Thomas Gleixner
2015-12-09 16:14           ` Aniroop Mathur
     [not found]             ` <CADYu309kcmtmZTSbnZ-o7TXjVYReg-QqOE+5bgsGqvPASMa4Zg@mail.gmail.com>
     [not found]               ` <566D3EC0.50408@ladisch.de>
2015-12-14 19:06                 ` Aniroop Mathur
2015-12-14 19:53                   ` Thomas Gleixner
2015-12-21 17:22                     ` Aniroop Mathur
2015-12-09  8:57 Aniroop Mathur

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=alpine.DEB.2.11.1512081147050.3595@nanos \
    --to=tglx@linutronix.de \
    --cc=a.mathur@samsung.com \
    --cc=aniroop.mathur@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.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®