From: Csdncannon <csdncannon@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Arnd Bergmann <arnd@arndb.de>, linuxppc-dev@ozlabs.org
Subject: Re: Continual reading from the PowerPc time base register is not stable
Date: Fri, 26 Mar 2010 10:01:20 +0800 [thread overview]
Message-ID: <43c137a81003251901h229b873bh7593c59a5ef66ae9@mail.gmail.com> (raw)
In-Reply-To: <50253.84.105.60.153.1269566569.squirrel@gate.crashing.org>
[-- Attachment #1.1: Type: text/plain, Size: 695 bytes --]
I enabled the printing of all values. There is bigger gap between two
reading, it seems isync bring to performance drop.
Could you elaborate what does "closer that 64 tick together" mean?
You can see the attached log, the 0x40 is not always set.
Thanks
Gino
2010/3/26 Segher Boessenkool <segher@kernel.crashing.org>
> > After trying the new code with "isync" and unsigned long long convertion,
> > this problem doesn't happen(I tested for several minutes).
>
> Do you now ever get two consecutive time readings that are closer
> that 64 tick together? If not, it's simply hiding the problem.
>
> Do you ever now read a value that does not have the bit with value
> 0x40 set?
>
>
> Segher
>
[-- Attachment #1.2: Type: text/html, Size: 1101 bytes --]
[-- Attachment #2: log --]
[-- Type: application/octet-stream, Size: 4466 bytes --]
Thu Jan 1 00:22:50 GMT 1970
0x1d66f3b12f
0x1d66f3b155
0x1d66f3b15f
0x1d66f3b171
0x1d66f3b17b
0x1d66f3b185
0x1d66f3b18f
0x1d66f3b1a0
0x1d66f3b1aa
0x1d66f3b1b4
0x1d66f3b1be
0x1d66f3b1cf
0x1d66f3b1d9
0x1d66f3b1e3
0x1d66f3b1ed
0x1d66f3b1fe
0x1d66f3b208
0x1d66f3b212
0x1d66f3b21c
0x1d66f3b22d
0x1d66f3b237
0x1d66f3b241
0x1d66f3b24b
0x1d66f3b25c
0x1d66f3b266
0x1d66f3b270
0x1d66f3b27a
0x1d66f3b28b
0x1d66f3b295
0x1d66f3b29f
0x1d66f3b2a9
0x1d66f3b2ba
0x1d66f3b2c4
0x1d66f3b2ce
0x1d66f3b2d8
0x1d66f3b2e9
0x1d66f3b2f3
0x1d66f3b2fd
0x1d66f3b307
0x1d66f3b318
0x1d66f3b322
0x1d66f3b32c
0x1d66f3b336
0x1d66f3b347
0x1d66f3b351
0x1d66f3b35b
0x1d66f3b365
0x1d66f3b376
0x1d66f3b380
0x1d66f3b38a
0x1d66f3b394
0x1d66f3b3a5
0x1d66f3b3af
0x1d66f3b3b9
0x1d66f3b3c3
0x1d66f3b3d4
0x1d66f3b3de
0x1d66f3b3e8
0x1d66f3b3f2
0x1d66f3b404
0x1d66f3b40e
0x1d66f3b419
0x1d66f3b423
--------------------
0x1d66f3b433
Thu Jan 1 00:22:51 GMT 1970
0x1d6728d175
0x1d6728d19b
0x1d6728d1a5
0x1d6728d1b6
0x1d6728d1c0
0x1d6728d1ca
0x1d6728d1d4
0x1d6728d1e5
0x1d6728d1ef
0x1d6728d1f9
0x1d6728d203
0x1d6728d214
0x1d6728d21e
0x1d6728d228
0x1d6728d232
0x1d6728d243
0x1d6728d24d
0x1d6728d257
0x1d6728d261
0x1d6728d272
0x1d6728d27c
0x1d6728d286
0x1d6728d290
0x1d6728d2a1
0x1d6728d2ab
0x1d6728d2b5
0x1d6728d2bf
0x1d6728d2d0
0x1d6728d2da
0x1d6728d2e4
0x1d6728d2ee
0x1d6728d2ff
0x1d6728d309
0x1d6728d313
0x1d6728d31d
0x1d6728d32f
0x1d6728d339
0x1d6728d344
0x1d6728d34e
0x1d6728d35e
0x1d6728d368
0x1d6728d373
0x1d6728d37d
0x1d6728d38d
0x1d6728d397
0x1d6728d3a2
0x1d6728d3ac
0x1d6728d3bc
0x1d6728d3c6
0x1d6728d3d1
0x1d6728d3db
0x1d6728d3eb
0x1d6728d3f5
0x1d6728d400
0x1d6728d40a
0x1d6728d41a
0x1d6728d424
0x1d6728d42f
0x1d6728d439
0x1d6728d449
0x1d6728d453
0x1d6728d45e
0x1d6728d468
--------------------
0x1d6728d478
Thu Jan 1 00:22:51 GMT 1970
0x1d675df210
0x1d675df236
0x1d675df240
0x1d675df251
0x1d675df25b
0x1d675df265
0x1d675df26f
0x1d675df281
0x1d675df28b
0x1d675df296
0x1d675df2a0
0x1d675df2b0
0x1d675df2ba
0x1d675df2c5
0x1d675df2cf
0x1d675df2df
0x1d675df2e9
0x1d675df2f4
0x1d675df2fe
0x1d675df30e
0x1d675df318
0x1d675df323
0x1d675df32d
0x1d675df33d
0x1d675df347
0x1d675df352
0x1d675df35c
0x1d675df36c
0x1d675df376
0x1d675df381
0x1d675df38b
0x1d675df39b
0x1d675df3a5
0x1d675df3b0
0x1d675df3ba
0x1d675df3ca
0x1d675df3d4
0x1d675df3df
0x1d675df3e9
0x1d675df3f9
0x1d675df403
0x1d675df40e
0x1d675df418
0x1d675df428
0x1d675df432
0x1d675df43d
0x1d675df447
0x1d675df457
0x1d675df461
0x1d675df46c
0x1d675df476
0x1d675df486
0x1d675df490
0x1d675df49b
0x1d675df4a5
0x1d675df4b5
0x1d675df4bf
0x1d675df4ca
0x1d675df4d4
0x1d675df4ec
0x1d675df4f6
0x1d675df500
0x1d675df50a
--------------------
0x1d675df51b
Thu Jan 1 00:22:51 GMT 1970
0x1d67931055
0x1d6793107b
0x1d67931085
0x1d67931095
0x1d6793109f
0x1d679310aa
0x1d679310b4
0x1d679310c4
0x1d679310ce
0x1d679310d9
0x1d679310e3
0x1d679310f3
0x1d679310fd
0x1d67931108
0x1d67931112
0x1d67931122
0x1d6793112c
0x1d67931137
0x1d67931141
0x1d67931151
0x1d6793115b
0x1d67931166
0x1d67931170
0x1d67931180
0x1d6793118a
0x1d67931195
0x1d6793119f
0x1d679311b1
0x1d679311bb
0x1d679311c5
0x1d679311cf
0x1d679311e0
0x1d679311ea
0x1d679311f4
0x1d679311fe
0x1d6793120f
0x1d67931219
0x1d67931223
0x1d6793122d
0x1d6793123e
0x1d67931248
0x1d67931252
0x1d6793125c
0x1d6793126d
0x1d67931277
0x1d67931281
0x1d6793128b
0x1d6793129c
0x1d679312a6
0x1d679312b0
0x1d679312ba
0x1d679312cb
0x1d679312d5
0x1d679312df
0x1d679312e9
0x1d679312fa
0x1d67931304
0x1d6793130e
0x1d67931318
0x1d67931329
0x1d67931333
0x1d6793133d
0x1d67931347
--------------------
0x1d67931358
Thu Jan 1 00:22:51 GMT 1970
0x1d67c826f2
0x1d67c82718
0x1d67c82722
0x1d67c82733
0x1d67c8273d
0x1d67c82747
0x1d67c82751
0x1d67c82762
0x1d67c8276c
0x1d67c82776
0x1d67c82780
0x1d67c82791
0x1d67c8279b
0x1d67c827a5
0x1d67c827af
0x1d67c827c0
0x1d67c827ca
0x1d67c827d4
0x1d67c827de
0x1d67c827ef
0x1d67c827f9
0x1d67c82803
0x1d67c8280d
0x1d67c8281e
0x1d67c82828
0x1d67c82832
0x1d67c8283c
0x1d67c8284d
0x1d67c82857
0x1d67c82861
0x1d67c8286b
0x1d67c8287c
0x1d67c82886
0x1d67c82890
0x1d67c8289a
0x1d67c828ab
0x1d67c828b5
0x1d67c828bf
0x1d67c828c9
0x1d67c828da
0x1d67c828e4
0x1d67c828ee
0x1d67c828f8
0x1d67c82909
0x1d67c82913
0x1d67c8291d
0x1d67c82927
0x1d67c82939
0x1d67c82943
0x1d67c8294e
0x1d67c82958
0x1d67c82968
0x1d67c82972
0x1d67c8297d
0x1d67c82987
0x1d67c82997
0x1d67c829a1
0x1d67c829ac
0x1d67c829b6
0x1d67c829c6
0x1d67c829d0
0x1d67c829db
0x1d67c829e5
--------------------
0x1d67c829f5
Thu Jan 1 00:22:51 GMT 1970
0x1d67fd67e2
0x1d67fd680b
[-- Attachment #3: timebase.c --]
[-- Type: application/octet-stream, Size: 1643 bytes --]
/* TSC sync test
* by: john stultz (johnstul@us.ibm.com)
* (C) Copyright IBM 2003, 2005
* Licensed under the GPL
*/
#include <stdio.h>
#include <sys/time.h>
#include <stdlib.h>
#define CALLS_PER_LOOP 64
volatile unsigned long long getTimeBase()
{
unsigned long upper,lower,upper2;
do {
asm volatile("sync; isync":::"memory");
asm volatile("mftbu %0" : "=r" (upper));
asm volatile("sync; isync":::"memory");
asm volatile("mftbl %0" : "=r" (lower));
asm volatile("sync; isync":::"memory");
asm volatile("mftbu %0" : "=r" (upper2));
asm volatile("sync; isync":::"memory");
}while(upper2!=upper);
return ((unsigned long long)upper<<32)|lower;
}
int main(int argc, char *argv[])
{
volatile unsigned long long list[CALLS_PER_LOOP];
bool bad[CALLS_PER_LOOP];
int i, inconsistent;
/* timestamp start of test */
system("date");
while(1){
inconsistent = 0;
/* Fill list */
for(i=0; i < CALLS_PER_LOOP; i++)
list[i] = getTimeBase();
/* Check for inconsistencies */
for(i=0; i < CALLS_PER_LOOP-1; i++)
{
if(list[i] > list[i+1])
{
inconsistent = i+1;
bad[i] = true;
}
else{
bad[i] = false;
}
}
inconsistent = 1;
/* display inconsistency */
if(inconsistent){
inconsistent--;
for(i=0; i < CALLS_PER_LOOP; i++){
if(bad[i] == true)
printf("--------------------\n");
printf("0x%llx\n",list[i]);
if(bad[i-1] == true && bad[i] == false )
printf("--------------------\n");
}
fflush(0);
/* timestamp inconsistency*/
system("date");
}
}
return 0;
}
next prev parent reply other threads:[~2010-03-26 2:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 2:41 Continual reading from the PowerPc time base register is not stable Csdncannon
2010-03-25 8:21 ` Benjamin Herrenschmidt
2010-03-25 10:05 ` Arnd Bergmann
2010-03-25 15:00 ` Csdncannon
2010-03-25 20:38 ` Benjamin Herrenschmidt
2010-03-26 1:11 ` Csdncannon
2010-03-26 1:22 ` Segher Boessenkool
2010-03-26 2:01 ` Csdncannon [this message]
2010-03-26 8:52 ` Segher Boessenkool
2010-03-26 9:01 ` Segher Boessenkool
2010-03-26 12:14 ` Csdncannon
2010-04-06 8:02 ` Csdncannon
2010-03-26 1:55 ` Benjamin Herrenschmidt
2010-03-26 2:04 ` Csdncannon
2010-03-25 22:00 ` Chris Friesen
2010-03-25 22:57 ` Benjamin Herrenschmidt
2010-03-25 23:37 ` Kumar Gala
2010-03-25 21:37 ` Segher Boessenkool
2010-04-10 3:14 ` Csdncannon
2010-04-22 0:44 ` Kim Phillips
2010-04-22 0:50 ` Benjamin Herrenschmidt
2010-04-22 23:27 ` Kim Phillips
2010-04-23 10:57 ` Csdncannon
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=43c137a81003251901h229b873bh7593c59a5ef66ae9@mail.gmail.com \
--to=csdncannon@gmail.com \
--cc=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=segher@kernel.crashing.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;
as well as URLs for NNTP newsgroup(s).