logging
Hal Murray
hmurray at megapathdsl.net
Sun Apr 14 21:49:37 UTC 2019
> HPET is a travel out to ACPI system registers mapped into memory, this should
> never be never cached.
Yes. But there is still the cache for code and data.
This sort of code is amazingly delicate. Minor changes can make interesting
changes in the results.
For example:
for (i = 0; i < BATCHSIZE; i++) {
clock_gettime(type, &start); /* warm up cache */
clock_gettime(type, &stop);
clock_gettime(type, &start);
clock_gettime(type, &stop);
...
The extra pair of clock_gettime-s cleaned things up a lot. At least on one of
my systems at some point in time.
At one point in time, I got different results when I reran a test. Sometimes
it would get duplicate samples. Try again and they didn't happen. That was
on a Pi 1. Ah. I just got another example.
res avg min dups CLOCK
1 1069 999 52564 CLOCK_REALTIME
10000000 820 9999898 -84 CLOCK_REALTIME_COARSE
1 1075 999 12920 CLOCK_MONOTONIC
1 1042 1000 62481 CLOCK_MONOTONIC_RAW
1 1521 999 CLOCK_BOOTTIME
Histogram: CLOCK_REALTIME, 1 ns per bucket, 1000000 samples.
ns hits
999 9577
1000 930001
1999 149
2000 6856
2999 2
3000 152
49105 samples were duplicated.
4158 samples were bigger than 3498.
res avg min dups CLOCK
1 1347 999 CLOCK_REALTIME
10000000 1028 9999890 -109 CLOCK_REALTIME_COARSE
1 1349 999 CLOCK_MONOTONIC
1 1279 1000 CLOCK_MONOTONIC_RAW
1 1838 999 CLOCK_BOOTTIME
Histogram: CLOCK_REALTIME, 1 ns per bucket, 1000000 samples.
ns hits
999 8357
1000 765081
1999 4814
2000 215894
2999 21
3000 632
5201 samples were bigger than 3498.
I'm guessing that it's something like the cache conflicts changing because of
address space randomization.
--
These are my opinions. I hate spam.
More information about the devel
mailing list