Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbWCVPa0 (ORCPT ); Wed, 22 Mar 2006 10:30:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751332AbWCVPaZ (ORCPT ); Wed, 22 Mar 2006 10:30:25 -0500 Received: from smtp.osdl.org ([65.172.181.4]:56039 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1751339AbWCVPaX (ORCPT ); Wed, 22 Mar 2006 10:30:23 -0500 Date: Wed, 22 Mar 2006 07:30:06 -0800 (PST) From: Linus Torvalds To: Knut Petersen cc: Dave Jones , Linux Kernel Mailing List , Andrew Morton Subject: Re: [BUG] wrong bogomips values with kernel 2.6.16 In-Reply-To: <4420DE54.1020004@t-online.de> Message-ID: References: <441FFB28.5050609@t-online.de> <4420DE54.1020004@t-online.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1119 Lines: 46 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). Linus --- #include #include #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); read_tsc(start); 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) break; } read_tsc(end); 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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/