From: Andi Kleen <ak@muc.de>
To: "Kirill Korotaev" <kksx@mail.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: can TSC tick with different speeds on SMP?
Date: Tue, 22 Jun 2004 05:30:30 +0200 [thread overview]
Message-ID: <m34qp4i815.fsf@averell.firstfloor.org> (raw)
In-Reply-To: <29Cl9-2Uu-13@gated-at.bofh.it> (Kirill Korotaev's message of "Mon, 21 Jun 2004 21:10:07 +0200")
"Kirill Korotaev" <kksx@mail.ru> writes:
> I've got some stupid question to SMP gurus and would be very
> thankful for the details. I suddenly faced an SMP system where
> different P4 cpus were installed (with different steppings). This
> resulted in different CPU clock speeds and different speeds of time
> stamp counters on these CPUs. I faced the problem during some
> timings I measured in the kernel.
Yes, it is a quite common problem. You'll have to deal with it
somehow. Somehow it can be fixed by disabling "cross spectrum
clocking" or similar in the BIOS setup, but on others it
is unfixable.
Ultimatively the kernel will need to move to a per CPU time base
to deal with this better, but that is a future project.
For user space I would suggest to use gettimeofday() or better
clock_gettime(CLOCK_MONOTONIC, ...) in 2.6 to get time stamps
and let the kernel deal with it.
>
> So the question is "is such system compliant with SMP
> specification?". In old kernels there was a code to syncronize TSCs
> and to detect if they were screwed up. Current kernels do not have
> such code. Is it intentional? I suppose there is some code in kernel
> which won't work find on such systems (real-time threads timing
> accounting and so on).
The usual way to is to turn off tsc support in gettimeofday. This can
be done by booting with "notsc" That should be the only code relying
on it. The scheduler did in some 2.6 versions, but that has been also
fixed (it can tolerate non monotonous times now). Other code
who reads the TSC directly has to deal with it.
e.g. x86-64 just forces HPET gettimeofday when SMP is on, which slows
down gettimeofday greatly.
-Andi
next parent reply other threads:[~2004-06-22 1:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <29Cl9-2Uu-13@gated-at.bofh.it>
2004-06-22 3:30 ` Andi Kleen [this message]
2004-06-21 19:02 can TSC tick with different speeds on SMP? "Kirill Korotaev"
2004-06-21 19:22 ` Pasi Savolainen
2004-06-21 19:32 ` Grzegorz Kulewski
2004-06-21 20:50 ` James Cleverdon
2004-06-21 21:09 ` Zwane Mwaikambo
2004-06-21 22:31 ` john stultz
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=m34qp4i815.fsf@averell.firstfloor.org \
--to=ak@muc.de \
--cc=kksx@mail.ru \
--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