Hi,
I've done some changes to lowlatency patched kernel. Mainly "fixes" to DRM
drivers and few network drivers. Most probably I have done something really
stupid, but those work here(tm). Especially the Radeon driver patch has got
a lot of testing and seems to have huge impact to latencies in my system.
Best regards,
- Jussi Laako
--
PGP key fingerprint: 161D 6FED 6A92 39E2 EB5B 39DD A4DE 63EB C216 1E4B
Available at PGP keyservers
diff -ur linux-2.4.17-lowlatency/drivers/char/drm/mga_dma.c
linux-2.4.17-lowlatency-jl/drivers/char/drm/mga_dma.c
--- linux-2.4.17-lowlatency/drivers/char/drm/mga_dma.c Wed Aug 8 19:42:15 2001
+++ linux-2.4.17-lowlatency-jl/drivers/char/drm/mga_dma.c Mon Dec 31 22:05:06
+2001
@@ -61,6 +61,7 @@
MGA_WRITE8( MGA_CRTC_INDEX, 0 );
return 0;
}
+ conditional_schedule();
udelay( 1 );
}
@@ -80,6 +81,7 @@
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
status = MGA_READ( MGA_STATUS ) & MGA_DMA_IDLE_MASK;
if ( status == MGA_ENDPRDMASTS ) return 0;
+ conditional_schedule();
udelay( 1 );
}
@@ -121,6 +123,7 @@
* How about we clean up after ourselves?
*/
MGA_WRITE( MGA_RST, MGA_SOFTRESET );
+ conditional_schedule(); /* We shouldn't get here anyway... */
udelay( 15 ); /* Wait at least 10 usecs */
MGA_WRITE( MGA_RST, 0 );
diff -ur linux-2.4.17-lowlatency/drivers/char/drm/r128_cce.c
linux-2.4.17-lowlatency-jl/drivers/char/drm/r128_cce.c
--- linux-2.4.17-lowlatency/drivers/char/drm/r128_cce.c Mon Aug 27 17:40:33 2001
+++ linux-2.4.17-lowlatency-jl/drivers/char/drm/r128_cce.c Mon Dec 31 22:08:38
+2001
@@ -128,6 +128,7 @@
if ( !(R128_READ( R128_PC_NGUI_CTLSTAT ) & R128_PC_BUSY) ) {
return 0;
}
+ conditional_schedule();
udelay( 1 );
}
@@ -144,6 +145,7 @@
for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) {
int slots = R128_READ( R128_GUI_STAT ) & R128_GUI_FIFOCNT_MASK;
if ( slots >= entries ) return 0;
+ conditional_schedule();
udelay( 1 );
}
@@ -165,6 +167,7 @@
r128_do_pixcache_flush( dev_priv );
return 0;
}
+ conditional_schedule();
udelay( 1 );
}
@@ -225,6 +228,7 @@
return r128_do_pixcache_flush( dev_priv );
}
}
+ conditional_schedule();
udelay( 1 );
}
@@ -928,6 +932,7 @@
return buf;
}
}
+ conditional_schedule();
udelay( 1 );
}
@@ -961,6 +966,7 @@
r128_update_ring_snapshot( ring );
if ( ring->space >= n )
return 0;
+ conditional_schedule();
udelay( 1 );
}
diff -ur linux-2.4.17-lowlatency/drivers/char/drm/radeon_cp.c
linux-2.4.17-lowlatency-jl/drivers/char/drm/radeon_cp.c
--- linux-2.4.17-lowlatency/drivers/char/drm/radeon_cp.c Sat Sep 15 00:29:41
2001
+++ linux-2.4.17-lowlatency-jl/drivers/char/drm/radeon_cp.c Mon Dec 31 21:59:45
+2001
@@ -356,6 +356,7 @@
& RADEON_RB2D_DC_BUSY) ) {
return 0;
}
+ conditional_schedule();
udelay( 1 );
}
@@ -375,6 +376,7 @@
int slots = ( RADEON_READ( RADEON_RBBM_STATUS )
& RADEON_RBBM_FIFOCNT_MASK );
if ( slots >= entries ) return 0;
+ conditional_schedule();
udelay( 1 );
}
@@ -398,6 +400,7 @@
radeon_do_pixcache_flush( dev_priv );
return 0;
}
+ conditional_schedule();
udelay( 1 );
}
@@ -1316,6 +1319,7 @@
start = 0;
#endif
}
+ conditional_schedule();
udelay( 1 );
}
@@ -1355,6 +1359,7 @@
radeon_update_ring_snapshot( ring );
if ( ring->space > n )
return 0;
+ conditional_schedule();
udelay( 1 );
}
diff -ur linux-2.4.17-lowlatency/drivers/net/3c59x.c
linux-2.4.17-lowlatency-jl/drivers/net/3c59x.c
--- linux-2.4.17-lowlatency/drivers/net/3c59x.c Fri Dec 21 19:41:54 2001
+++ linux-2.4.17-lowlatency-jl/drivers/net/3c59x.c Mon Dec 31 22:31:10 2001
@@ -1368,6 +1368,7 @@
dev->name, cmd, i * 10);
return;
}
+ conditional_schedule();
udelay(10);
}
printk(KERN_ERR "%s: command 0x%04x did not complete! Status=0x%x\n",
diff -ur linux-2.4.17-lowlatency/drivers/net/8139too.c
linux-2.4.17-lowlatency-jl/drivers/net/8139too.c
--- linux-2.4.17-lowlatency/drivers/net/8139too.c Fri Dec 21 19:41:54 2001
+++ linux-2.4.17-lowlatency-jl/drivers/net/8139too.c Mon Dec 31 22:33:00 2001
@@ -707,6 +707,7 @@
barrier();
if ((RTL_R8 (ChipCmd) & CmdReset) == 0)
break;
+ conditional_schedule();
udelay (10);
}
}
@@ -1774,6 +1775,7 @@
RTL_W8_F (ChipCmd, CmdTxEnb);
tmp_work = 200;
while (--tmp_work > 0) {
+ conditional_schedule();
udelay(1);
tmp8 = RTL_R8 (ChipCmd);
if (!(tmp8 & CmdRxEnb))
@@ -1785,6 +1787,7 @@
tmp_work = 200;
while (--tmp_work > 0) {
RTL_W8_F (ChipCmd, CmdRxEnb | CmdTxEnb);
+ conditional_schedule();
udelay(1);
tmp8 = RTL_R8 (ChipCmd);
if ((tmp8 & CmdRxEnb) && (tmp8 & CmdTxEnb))
diff -ur linux-2.4.17-lowlatency/drivers/net/eepro100.c
linux-2.4.17-lowlatency-jl/drivers/net/eepro100.c
--- linux-2.4.17-lowlatency/drivers/net/eepro100.c Fri Dec 21 19:41:54 2001
+++ linux-2.4.17-lowlatency-jl/drivers/net/eepro100.c Mon Dec 31 22:41:42 2001
@@ -324,7 +324,11 @@
static inline void wait_for_cmd_done(long cmd_ioaddr)
{
int wait = 1000;
- do udelay(1) ;
+ do
+ {
+ conditional_schedule();
+ udelay(1) ;
+ }
while(inb(cmd_ioaddr) && --wait >= 0);
#ifndef final_version
if (wait < 0)