From: corbet@lwn.net (Jonathan Corbet)
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH/RFC] msleep() with hrtimers
Date: Mon, 16 Jul 2007 11:46:09 -0600 [thread overview]
Message-ID: <28799.1184607969@lwn.net> (raw)
In-Reply-To: Your message of "Mon, 16 Jul 2007 17:43:22 +0200." <Pine.LNX.4.64.0707161654130.1817@scrub.home>
Roman Zippel <zippel@linux-m68k.org> wrote:
> > That's a possibility, I admit I haven't benchmarked it. I will say that
> > I don't think it will be enough to matter - msleep() is not a hot-path
> > sort of function. Once the system is up and running it almost never
> > gets called at all - at least, on my setup.
>
> That's a bit my problem - we have to consider other setups as well.
> Is it worth converting all msleep users behind their back or should we
> just a provide a separate function for those who care?
Any additional overhead is clearly small - enough not to disrupt a *high
resolution* timer, after all. And msleep() is used mostly during
initialization time. My box had a few hundred calls, almost all during
boot. Any cost will be bounded by the fact that, well, it sleeps for
milliseconds on every call.
I could run a million-msleep profile if you really want, but I just
can't imagine it's going to have a measurable effect on any real-world
situation. Is there a specific setup you're worried about?
I'm not *that* attached to this patch; if it causes heartburn we can
just forget it. But I had thought it might be useful...
> Which driver is this? I'd like to look at this, in case there's some other
> hidden problem.
drivers/media/video/cafe_ccic.c, and cafe_smbus_write_data() in
particular. The "hidden problem," though, is that the hardware has
periods where reading the status registers will send it off into its
room where it will hide under its bed and never come out.
I have an alternative which avoids the sleep at the cost of a small,
relatively harmless race; it may be my real solution in the end, we'll
see.
> > Except that then, with the current implementation, you're paying for the
> > higher HZ whenever the CPU is busy. I bet that doesn't take long to
> > overwhelm any added overhead in the hrtimer msleep().
>
> Actually if that's the case I'd consider this a bug, where is that extra
> cost coming from?
My understanding is that the current dyntick code only turns off the
tick during idle periods; while things are running it's business as
usual. Perhaps I misunderstood?
jon
next prev parent reply other threads:[~2007-07-16 17:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-15 22:42 [PATCH/RFC] msleep() with hrtimers Jonathan Corbet
2007-07-15 23:10 ` Arnd Bergmann
2007-07-16 10:48 ` Ingo Molnar
2007-07-16 11:39 ` Roman Zippel
2007-07-16 11:47 ` Ingo Molnar
2007-07-16 11:54 ` Roman Zippel
2007-07-16 11:57 ` Ingo Molnar
2007-07-16 12:05 ` Roman Zippel
2007-07-16 12:19 ` Ingo Molnar
2007-07-16 13:00 ` Roman Zippel
2007-07-16 14:09 ` Ingo Molnar
2007-07-16 14:32 ` Roman Zippel
2007-07-16 14:42 ` Jonathan Corbet
2007-07-16 15:18 ` Ingo Molnar
2007-07-16 15:43 ` Roman Zippel
2007-07-16 15:57 ` Ray Lee
2007-07-16 16:08 ` Nish Aravamudan
2007-07-17 4:04 ` Nick Piggin
2007-07-18 17:53 ` Nish Aravamudan
2007-07-16 16:10 ` Ingo Molnar
2007-07-16 16:55 ` Roman Zippel
2007-07-16 17:46 ` Jonathan Corbet [this message]
2007-07-20 12:49 ` Roman Zippel
2007-07-16 14:11 ` Roman Zippel
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=28799.1184607969@lwn.net \
--to=corbet@lwn.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=zippel@linux-m68k.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