kernel-packages team mailing list archive
-
kernel-packages team
-
Mailing list archive
-
Message #170153
[Bug 1564949] [NEW] Severe latency/skew on AMD Opetron processor
Public bug reported:
Discovered this while doing pre-release certification testing for 16.04
on an HP ProLiant DL385p Gen8 with an AMD Opteron 6320 8-core CPU.
I have some code that essentially does this: And note, I am NOT a C
programmer, I know enough C to read it and do some minor things, and I
once knew C++ fairly well, about 10 years ago...
gettimeofday(&tval_start, NULL);
sleep(sleeptime);
gettimeofday(&tval_stop, NULL);
where tval_start and tval_stop are timeval structs and sleeptime is 60.
Once it gets the start and stop it finds the delta minus the sleep time.
In a perfect world, for example, start time would be 123456.123 and
end time would be 123516.123 and the delta between them minus the 60
seconds of sleep would be 0.
Of course, that isn't how it works in reality so the delta may be a
few microseconds here and there depending on what else the kernel is
doing at any given moment. The following, however, are on essentially
idle Xenial systems (only processes running are whatever Ubuntu Server
runs by default, nothing really taxing going on).
On my Skylake i7 with Xenial, the time differences are never more than
a few 10,000ths of a second: (kernel 4.4.0-15.31)
Testing clock direction for 5 minutes...
PASSED: Iteration 0 delta: 0.000109
PASSED: Iteration 1 delta: 0.000068
PASSED: Iteration 2 delta: 0.000107
PASSED: Iteration 3 delta: 0.000216
PASSED: Iteration 4 delta: 0.000089
On a zVM instance (kernel 4.4.0-16.32) it's even better:
PASSED: Iteration 0 delta: 0.000058
PASSED: Iteration 1 delta: 0.000058
PASSED: Iteration 2 delta: 0.000074
PASSED: Iteration 3 delta: 0.000052
PASSED: Iteration 4 delta: 0.000062
But on an AMD cpu with Xenial (the only AMD CPU I have access to), the
difference is always in the 10ths of a second, sometimes even several
seconds... in other words, I've seen up to a 7.9 second delta with
this code. Here's one run that shows 3 seconds in one iteration:
(kernel 4.4.0-15.31)
FAILED: Iteration 0 delta: 3.057980
FAILED: Iteration 1 delta: 0.225712
FAILED: Iteration 2 delta: 0.241468
FAILED: Iteration 3 delta: 0.229084
FAILED: Iteration 4 delta: 0.223933
I ran a second run on the AMD cpu and the latency was all over the place:
FAILED: Iteration 0 delta: 9.302149
FAILED: Iteration 1 delta: 0.624466
FAILED: Iteration 2 delta: 1.644834
FAILED: Iteration 3 delta: 1.011474
FAILED: Iteration 4 delta: 0.923033
After a discussion with cking and apw, deviations of as seen on the
Intel and s390 CPUs are about what we should expect to see depending on
what the system is doing at the moment gettimeofday() is executed.
However, on the AMD CPU, differences of up to 9 seconds or more are NOT
expected and highly irregular.
Colin said he tested this on an AMD C60 CPU and got numbers inline with
the Skylake and s390 chips and could not reproduce the times I am seeing
on the Opteron.
$ cat /proc/version_signature
Ubuntu 4.4.0-15.31-generic 4.4.6
** Affects: linux (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1564949
Title:
Severe latency/skew on AMD Opetron processor
Status in linux package in Ubuntu:
New
Bug description:
Discovered this while doing pre-release certification testing for
16.04 on an HP ProLiant DL385p Gen8 with an AMD Opteron 6320 8-core
CPU.
I have some code that essentially does this: And note, I am NOT a C
programmer, I know enough C to read it and do some minor things, and I
once knew C++ fairly well, about 10 years ago...
gettimeofday(&tval_start, NULL);
sleep(sleeptime);
gettimeofday(&tval_stop, NULL);
where tval_start and tval_stop are timeval structs and sleeptime is
60.
Once it gets the start and stop it finds the delta minus the sleep
time.
In a perfect world, for example, start time would be 123456.123 and
end time would be 123516.123 and the delta between them minus the 60
seconds of sleep would be 0.
Of course, that isn't how it works in reality so the delta may be a
few microseconds here and there depending on what else the kernel is
doing at any given moment. The following, however, are on essentially
idle Xenial systems (only processes running are whatever Ubuntu Server
runs by default, nothing really taxing going on).
On my Skylake i7 with Xenial, the time differences are never more than
a few 10,000ths of a second: (kernel 4.4.0-15.31)
Testing clock direction for 5 minutes...
PASSED: Iteration 0 delta: 0.000109
PASSED: Iteration 1 delta: 0.000068
PASSED: Iteration 2 delta: 0.000107
PASSED: Iteration 3 delta: 0.000216
PASSED: Iteration 4 delta: 0.000089
On a zVM instance (kernel 4.4.0-16.32) it's even better:
PASSED: Iteration 0 delta: 0.000058
PASSED: Iteration 1 delta: 0.000058
PASSED: Iteration 2 delta: 0.000074
PASSED: Iteration 3 delta: 0.000052
PASSED: Iteration 4 delta: 0.000062
But on an AMD cpu with Xenial (the only AMD CPU I have access to), the
difference is always in the 10ths of a second, sometimes even several
seconds... in other words, I've seen up to a 7.9 second delta with
this code. Here's one run that shows 3 seconds in one iteration:
(kernel 4.4.0-15.31)
FAILED: Iteration 0 delta: 3.057980
FAILED: Iteration 1 delta: 0.225712
FAILED: Iteration 2 delta: 0.241468
FAILED: Iteration 3 delta: 0.229084
FAILED: Iteration 4 delta: 0.223933
I ran a second run on the AMD cpu and the latency was all over the place:
FAILED: Iteration 0 delta: 9.302149
FAILED: Iteration 1 delta: 0.624466
FAILED: Iteration 2 delta: 1.644834
FAILED: Iteration 3 delta: 1.011474
FAILED: Iteration 4 delta: 0.923033
After a discussion with cking and apw, deviations of as seen on the
Intel and s390 CPUs are about what we should expect to see depending
on what the system is doing at the moment gettimeofday() is executed.
However, on the AMD CPU, differences of up to 9 seconds or more are
NOT expected and highly irregular.
Colin said he tested this on an AMD C60 CPU and got numbers inline
with the Skylake and s390 chips and could not reproduce the times I am
seeing on the Opteron.
$ cat /proc/version_signature
Ubuntu 4.4.0-15.31-generic 4.4.6
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1564949/+subscriptions
Follow ups
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-06-10
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-06-10
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-05-11
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-05-03
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Rod Smith, 2016-04-29
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-28
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-27
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Colin Ian King, 2016-04-01
-
[Bug 1564949] Status changed to Confirmed
From: Brad Figg, 2016-04-01
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] WifiSyslog.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] UdevDb.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] ProcModules.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] ProcInterrupts.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] ProcCpuinfo.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] Lsusb.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] Lspci.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] JournalErrors.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] CurrentDmesg.txt
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-04-01
-
[Bug 1564949] Re: Severe latency/skew on AMD Opetron processor
From: Jeff Lane, 2016-04-01