[openib-general] cycles_to_units is incorrect in rdma_lat, rdma_bw.

Grant Grundler iod00d at hp.com
Fri Jun 10 09:45:37 PDT 2005


On Thu, Jun 09, 2005 at 10:13:13PM -0700, Shirley Ma wrote:
> >I think adding such a calibration to get_cpu_mhz()
> >so we can warn if /proc/cpuinfo data doesn't agree with
> >gettimeofday() and get_cycles().
> 
> using below to calculate the cycles_to_unit is more accurate.
> 
>         clock_gettime();
>         get_cycles();
>         sleep(5);
>         clock_gettime();
>         get_cycles();

While I agree in general with the concept, I don't
agree with this algorithm for two reaons:
o I don't trust get_cycles() to measure anything more than 1s.
  Problem is on some 32-bit arches, they may only have (or only read)
  a 32-bit cycle counter.  This can wrap in as little as 2 or 3 seconds.
  This obviously isn't a problem with 64-bit counters.

o Trivial but annoying - adding 5 seconds per run means a scripted
  batch job could take minutes longer.

> cycles_to_unit = offset - cycles/ offset - time;

I think we can effectively do the same thing by summing the
recorded "get_cycles" values and compare that sum to before/after
gettimeofday() readings. I'll submit a patch later today that
effectively does that.

grant



More information about the general mailing list