From: "Mark Langsdorf" <mark.langsdorf@amd.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Ian Pratt <Ian.Pratt@eu.citrix.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] Disable Xen PowerNow! support on Opteron 2nd gen and earlier processors
Date: Fri, 25 Jan 2008 16:58:39 -0600 [thread overview]
Message-ID: <200801251658.40027.mark.langsdorf@amd.com> (raw)
In-Reply-To: <C3BD7902.12BE7%Keir.Fraser@cl.cam.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 2726 bytes --]
On Wednesday 23 January 2008, Keir Fraser wrote:
> On 23/1/08 22:34, "Ian Pratt" <Ian.Pratt@eu.citrix.com> wrote:
>
> > Since we probably don't know how long we had to wait between when the
> > multipler was increased and when the CPU was un-paused, it will be
> > necessary to recalibrate the CPU to the global time source (PIT/HPET).
>
> Yes, actually that is a good point. Possibly we would get better results by
> setting t->stime_local_stamp = t->stime_master_stamp = read_platform_stime()
> in xen/arch/x86/time.c:cpu_frequency_change(). Currently we set the local
> stamp to get_s_time(), but get_s_time() may not be trustworthy.
I tried this suggestion and also implemented the trace function in
cpu_frequency_change() and local_time_calibration() you suggested in
a previous message.
It made no discernable difference in my tests. I did high to low
and low to high changes roughly every five minutes, and always got
an excessive difference inside of Xen and usually got error messages
in Linux.
Changed code follows and the xm dmesg log is attached.
diff -r 62fc84adc8ed xen/arch/x86/time.c
--- a/xen/arch/x86/time.c Fri Jan 18 13:43:26 2008 +0000
+++ b/xen/arch/x86/time.c Fri Jan 25 16:45:03 2008 -0600
@@ -724,6 +724,20 @@ void update_domain_wallclock_time(struct
spin_unlock(&wc_lock);
}
+void checktime(char *buf);
+void checktime(char *buf)
+{
+ u64 s_tmp, p_tmp, diff;
+ s_tmp = get_s_time();
+ p_tmp = read_platform_stime();
+ if (s_tmp > p_tmp)
+ diff = s_tmp - p_tmp;
+ else
+ diff = p_tmp - s_tmp;
+ if (diff > 50000000)
+ printk(KERN_ERR "%s:time differed by %lu platform time %lu, systime %lu\n", buf, diff, p_tmp, s_tmp);
+}
+
int cpu_frequency_change(u64 freq)
{
struct cpu_time *t = &this_cpu(cpu_time);
@@ -732,11 +746,14 @@ int cpu_frequency_change(u64 freq)
local_irq_disable();
rdtscll(curr_tsc);
t->local_tsc_stamp = curr_tsc;
- t->stime_local_stamp = get_s_time();
+// t->stime_local_stamp = get_s_time();
t->stime_master_stamp = read_platform_stime();
+ t->stime_local_stamp = t->stime_master_stamp;
set_time_scale(&t->tsc_scale, freq);
+checktime("frequency_change");
local_irq_enable();
+printk(KERN_ERR "freq change at %lu\n", t->stime_master_stamp);
/* A full epoch should pass before we check for deviation. */
set_timer(&t->calibration_timer, NOW() + EPOCH);
if ( smp_processor_id() == 0 )
@@ -808,6 +825,7 @@ static void local_time_calibration(void
rdtscll(curr_tsc);
curr_local_stime = get_s_time();
curr_master_stime = read_platform_stime();
+checktime("calibration");
local_irq_enable();
#if 0
[-- Attachment #2: xen_revf_time.log.gz --]
[-- Type: application/x-gzip, Size: 3118 bytes --]
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2008-01-25 22:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 17:52 [PATCH] Disable Xen PowerNow! support on Opteron 2nd gen and earlier processors Mark Langsdorf
2008-01-22 21:16 ` Ian Pratt
2008-01-22 21:51 ` Keir Fraser
2008-01-23 2:04 ` [PATCH] Disable Xen PowerNow! support on Opteron2nd " Tian, Kevin
2008-01-23 15:17 ` [PATCH] Disable Xen PowerNow! support on Opteron 2nd " Langsdorf, Mark
2008-01-23 15:26 ` Keir Fraser
2008-01-23 15:31 ` Langsdorf, Mark
2008-01-23 15:41 ` Keir Fraser
2008-01-25 17:19 ` Stephen C. Tweedie
2008-01-25 17:46 ` John Levon
2008-01-25 18:18 ` Keir Fraser
2008-01-25 18:12 ` Keir Fraser
2008-01-23 20:27 ` Ian Pratt
2008-01-23 21:34 ` Langsdorf, Mark
2008-01-23 22:34 ` Ian Pratt
2008-01-23 23:04 ` Langsdorf, Mark
2008-01-23 23:06 ` Keir Fraser
2008-01-25 22:58 ` Mark Langsdorf [this message]
2008-01-25 23:22 ` Keir Fraser
2008-01-25 23:31 ` Xavian-Anderson Macpherson
2008-01-25 23:41 ` [PATCH] Disable Xen PowerNow! support on Opteron2nd " Ian Pratt
2008-01-26 0:32 ` [PATCH] Disable Xen PowerNow! support on Opteron 2nd " Langsdorf, Mark
2008-01-26 0:54 ` Langsdorf, Mark
2008-01-26 8:16 ` Keir Fraser
2008-01-26 11:30 ` Keir Fraser
2008-01-28 21:52 ` Langsdorf, Mark
2008-01-28 22:00 ` Keir Fraser
2008-01-29 9:53 ` Keir Fraser
2008-01-29 10:32 ` Keir Fraser
2008-01-29 11:20 ` Keir Fraser
2008-01-29 16:13 ` Langsdorf, Mark
2008-02-11 11:27 ` Ralf Schenk
2008-02-01 16:39 ` Langsdorf, Mark
2008-02-02 10:34 ` Keir Fraser
2008-02-04 21:52 ` Langsdorf, Mark
2008-02-04 22:41 ` Keir Fraser
2008-01-25 23:39 ` Ian Pratt
2008-01-26 0:21 ` Langsdorf, Mark
2008-01-23 22:34 ` Keir Fraser
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=200801251658.40027.mark.langsdorf@amd.com \
--to=mark.langsdorf@amd.com \
--cc=Ian.Pratt@eu.citrix.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.