mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Aniroop Mathur <aniroop.mathur@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	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 usleep_range for more than 20ms delay ?
Date: Tue, 8 Dec 2015 10:03:59 +0100	[thread overview]
Message-ID: <56669CFF.8040806@ladisch.de> (raw)
In-Reply-To: <CADYu308GqGO8C2UA1H39u0ASBmRYcaOJD2pGEK2NenqtED_WhA@mail.gmail.com>

Aniroop Mathur wrote:
> As in the kernel documentation, it is mentioned to use msleep for
> 10ms+ delay, I am confused whether there would be any disadvantage in
> using usleep_range for higher delays values because normally drivers
> have variety of delays used (2, 10, 20, 40, 100, 500 ms).
>
> So, could you please help to confirm that if we use usleep_range for
> inserting delays greater than 20 ms, would it be harmful or beneficial
> or does not make any difference at all ?

As the documentation told you, usleep_range() is likely to require
a separate interrupt, while msleep() is likely to round to some other,
already-scheduled interrupt.  The former is possibly harmful regarding
CPU and power usage; you have to balance it against your need for
accuracy.

(And usleep_range() has a 32-bit nanosecond limit on 32-bit
architectures.)


Regards,
Clemens

  reply	other threads:[~2015-12-08  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 17:59 Aniroop Mathur
2015-12-08  9:03 ` Clemens Ladisch [this message]
2015-12-08 19:21   ` 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=56669CFF.8040806@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=a.mathur@samsung.com \
    --cc=aniroop.mathur@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

Powered by JetHome