From: "Guillaume Chazarain" <guichaz@gmail.com>
To: "Mathieu Desnoyers" <mathieu.desnoyers@polymtl.ca>
Cc: "Andi Kleen" <ak@suse.de>, "john stultz" <johnstul@us.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add an offset in the cyc2ns computation to fix sched_clock jumps
Date: Sun, 18 Mar 2007 23:09:11 +0100 [thread overview]
Message-ID: <3d8471ca0703181509j11485441ybfae3631894c2a66@mail.gmail.com> (raw)
In-Reply-To: <20070318210819.GB19818@Krystal>
2007/3/18, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>:
> Hi Guillaume,
Hi Mathieu, thanks for your extensive reply.
> yet another level of band-aid over a
I don't agree it's a band-aid, changing the scaling coefficient
without adjusting an offset is a bug.
> broken architecture : AMD 7th and 8th generations
Actually in my case it's Intel Pentium M Dothan.
> other parts of the kernel suffers from those TSC inconsistencies
These other parts should not use sched_clock() but the clocksource
mechanism which in my case rightly avoids the TSC and uses the
ACPI timer. And I hope it will stay that way as the TSC definitely is
not a reliable time source in my case for the reasons you gave.
> it does not deal with frequency scaling due to temperature related
> events, and does not, as I recall, deal with frequency scaling in halt
> mode.
Yep, I saw this, that's why I said in this case sched_clock() does not
return nanoseconds as it thinks it does. Thankfully, the scheduler is
not stressed when the CPU is idle. Anyway, spilling on another thread,
this is a bonus point for the RSDL scheduler as it does not account
the sleeping time of tasks.
> I also plan to update this global last_tsc every timer tick to give a
> higher bound to time accuracy.
Then I don't see how this is significantly better than the ACPI timer
except for the increased precision in short durations. For example,
my CPU can lower its frequency down to 798 MHz and the TSC
down to 350 MHz or so (measured). So your clock will think the
TSC runs at 798 MHz when it runs at 350MHz, and every tick the
clock will make a half tick jump to catch up with its delay.
The best solution seems to buy a new computer with a reliable
TSC ;-)
Thanks.
--
Guillaume
prev parent reply other threads:[~2007-03-18 22:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-16 18:14 Guillaume Chazarain
2007-03-16 18:22 ` Andi Kleen
2007-03-16 18:48 ` Guillaume Chazarain
2007-03-16 18:26 ` john stultz
2007-03-16 18:30 ` Daniel Walker
2007-03-16 18:36 ` Andreas Kleen
2007-03-16 18:44 ` Guillaume Chazarain
2007-03-18 21:08 ` Mathieu Desnoyers
2007-03-18 22:09 ` Guillaume Chazarain [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=3d8471ca0703181509j11485441ybfae3631894c2a66@mail.gmail.com \
--to=guichaz@gmail.com \
--cc=ak@suse.de \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
/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®