From: Andrea Arcangeli <andrea@suse.de>
To: dean gaudet <dean@arctic.org>
Cc: john stultz <johnstul@us.ibm.com>,
ak@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de,
mingo@elte.hu, Suleiman Souhlal <ssouhlal@FreeBSD.org>
Subject: Re: rdtscp vgettimeofday
Date: Mon, 11 Dec 2006 22:32:36 +0100 [thread overview]
Message-ID: <20061211213235.GN5363@opteron.random> (raw)
In-Reply-To: <Pine.LNX.4.64.0612111302440.22490@twinlark.arctic.org>
On Mon, Dec 11, 2006 at 01:17:25PM -0800, dean gaudet wrote:
> rdtscp doesn't solve anything extra [..]
> [..] lsl-based vgetcpu is relatively slow
Well, if you accept to run slow there's nothing to solve in the first
place indeed.
If nothing else rdtscp should avoid the mess of restarting a
vsyscalls, which is quite a difficult problem as it heavily depends on
the compiler/dwarf.
> even with rdtscp you have to deal with the definite possibility of being
> scheduled away in the middle of the computation. arguably you need
> to
Isn't rdtscp atomic? all you need is to read atomically the current
contents of the tsc and the index to use in a per-cpu table exported
in readonly. This table will contain a per-cpu seqlock as well. Then a
math logic has to be built with per-cpu threads, so that those per-cpu
tables are updated by cpufreq and at regular intervals.
If this is all wrong and it's not feasible to implement a safe and
monothonic vgettimeofday that doesn't access the southbridge and that
doesn't require restarting the vsyscall manually by patching rip/rsp,
I've an hard time to see how rdtscp is useful at all. I hope somebody
thought about those issues before adding a new instruction to a
popular CPU ;).
next prev parent reply other threads:[~2006-12-11 21:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-29 3:00 [PATCH 0/5][time][x86_64] GENERIC_TIME patchset for x86_64 john stultz
2006-11-29 3:00 ` [PATCH 1/5][time][Generic] vsyscall-gtod support for GENERIC_TIME john stultz
2006-11-29 3:00 ` [PATCH 2/5][time][x86_64] hpet_address cleanup john stultz
2006-11-29 3:00 ` [PATCH 3/5][time][x86_64] Split x86_64/kernel/time.c up john stultz
2006-11-29 3:00 ` [PATCH 4/5][time][x86_64] Convert x86_64 to use GENERIC_TIME john stultz
2006-12-11 0:39 ` rdtscp vgettimeofday Andrea Arcangeli
2006-12-11 21:17 ` dean gaudet
2006-12-11 21:32 ` Andrea Arcangeli [this message]
2006-12-11 23:15 ` dean gaudet
2006-12-11 23:38 ` Andrea Arcangeli
2006-11-29 3:00 ` [PATCH 5/5][time][x86_64] Re-enable vsyscall support for x86_64 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=20061211213235.GN5363@opteron.random \
--to=andrea@suse.de \
--cc=ak@suse.de \
--cc=dean@arctic.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=ssouhlal@FreeBSD.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