lkml.org 
[lkml]   [1998]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: BogoMIPS
On Sat, 3 Oct 1998, Alan Cox wrote:

> > > As a result, 2.0.x just does it as a separate subroutine in
> > >
> > > arch/i386/lib/delay.S
> > >
> > > and that pretty much forces it to not jitter at all. If you'd send me that
> > > kind of patch I'd accept it.
>
> It jitters on cyrix unless you force alignments too. I've not figured out
> the logic that can cause this just that it happens.
>
> > I think the right thing is to use the TSC if the machine has one
> > (which can be trusted.) That leaves only older, simple machines to
> > use timing loops.
>
> That needs the time.c patches to 2.1.x otherwise you cant use non intel
> chips TSC or use the TSC on an APM aware kernel
>
>

This works and gets rid of the two jmps that everybody complained about.




--- linux-2.1.123/arch/i386/lib/delay.c.orig Sun Dec 21 20:27:18 1997
+++ linux-2.1.123/arch/i386/lib/delay.c Wed Sep 30 20:45:23 1998
@@ -6,6 +6,12 @@
*
* The __delay function must _NOT_ be inlined as its execution time
* depends wildly on alignment on many x86 processors.
+ *
+ * 29-SEP-1998 rjohnson@analogic.com
+ * Modified __delay() to remove alignment problems for all current
+ * processors. Code does a long (far) return to the actual delay
+ * loop after putting the complete address on the stack. This starts
+ * the loop with a new cache-line in the prefetch queue.
*/

#include <linux/sched.h>
@@ -18,7 +24,11 @@
void __delay(unsigned long loops)
{
__asm__ __volatile__(
- "1:\tdecl %0\n\tjns 1b"
+ "\tpushl %%cs\n"
+ "\tpushl $doit\n"
+ "\tlret\n"
+ ".align 16\n"
+ "doit:\tdecl %%eax\n\tjns doit"
:/* no outputs */
:"a" (loops)
:"ax");



Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.123 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.090 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site