[lkml]   [2006]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [BUG] wrong bogomips values with kernel 2.6.16

    On Wed, 22 Mar 2006, Knut Petersen wrote:
    > All Pentium M, Xeon up to model 2 and the P6 family increment with every
    > internal processor cycle.

    Just to humor me. Try the bogomips loop in user space with something like
    the appended (make sure the frequency is fixed to the lowest frequency).

    #include <stdio.h>
    #include <sys/time.h>

    #define read_tsc(r) asm volatile("rdtsc":"=A" (r))

    int main(int argc, char **argv)
    struct timeval a;
    unsigned long start, end;
    unsigned long mhz, low;

    gettimeofday(&a, NULL);
    for (;;) {
    unsigned long usec;
    struct timeval b;
    gettimeofday(&b, NULL);
    usec = (b.tv_sec - a.tv_sec)*1000000;
    usec += b.tv_usec - a.tv_usec;
    if (usec >= 1000000)
    end -= start;
    mhz = end / 1000000;
    low = end % 1000000;
    printf("TSC: %lu.%06lu MHz\n", mhz, low);
    return 0;
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2009-11-18 23:46    [W:0.020 / U:0.504 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site