lkml.org 
[lkml]   [1999]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[patch] lowlatency-2.3.12-A0, sound, multimedia performance, etc.

On Fri, 23 Jul 1999 est@hyperreal.org wrote:

> Benno's latencytest is great: www.gardena.net/benno/linux/audio/
>
> I'd come to about the same conclusions he does just watching /dev/rtc
> skips at 1khz.

now i can reproduce it as well - thanks to Benno's cool utility. Could you
(and everybody else having sound problems under high load) try the
attached patch?

It dramatically reduces sound skipping here:

[root@hell latencytest0.41]# ./latencytest none 3 256 0 350000000
fragment latency = 1.451247 ms
cpu latency = 1.160998 ms
2.4ms ( 0)|
1MS num_time_samples=21856 num_times_within_1ms=21856 factor=100.000000
2MS num_time_samples=21856 num_times_within_2ms=21856 factor=100.000000
[...]
314 root 18 0 740 740 576 R 0 97.3 0.5 0:02 top
300 root 16 0 672 672 356 R 0 81.6 0.5 0:24 latencytest

top -d 0.01 was running during the above test - it caused lots of skipping
before. Generating heavy disk IO on the patched kernel does not cause a
single missed fragment either.

the patch reduces the size of some critical 'scheduling atoms', ie. the
size of code paths within the kernel that execute code without ever
checking for ->need_resched. The solution in the patch is not final, but
i'd first like to identify all remaining problems that affect scheduling
latencies.

The patch is for 2.3.12, but should apply to 2.2.10 as well.

-- mingo

--- linux/include/asm-i386/uaccess.h.orig2 Sat Jul 24 00:54:18 1999
+++ linux/include/asm-i386/uaccess.h Sat Jul 24 00:55:48 1999
@@ -270,6 +270,7 @@
: "=&c"(size), "=&D" (__d0), "=&S" (__d1) \
: "r"(size & 3), "0"(size / 4), "1"(to), "2"(from) \
: "memory"); \
+ if (current->need_resched) schedule(); \
} while (0)

#define __copy_user_zeroing(to,from,size) \
@@ -298,6 +299,7 @@
: "=&c"(size), "=&D" (__d0), "=&S" (__d1) \
: "r"(size & 3), "0"(size / 4), "1"(to), "2"(from) \
: "memory"); \
+ if (current->need_resched) schedule(); \
} while (0)

/* We let the __ versions of copy_from/to_user inline, because they're often
@@ -338,6 +340,7 @@
: "=c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
+ if (current->need_resched) schedule(); \
break; \
case 1: \
__asm__ __volatile__( \
@@ -428,6 +431,7 @@
: "=c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
+ if (current->need_resched) schedule(); \
break; \
case 1: \
__asm__ __volatile__( \--- linux/include/asm-i386/uaccess.h.orig2 Sat Jul 24 00:54:18 1999
+++ linux/include/asm-i386/uaccess.h Sat Jul 24 00:55:48 1999
@@ -270,6 +270,7 @@
: "=&c"(size), "=&D" (__d0), "=&S" (__d1) \
: "r"(size & 3), "0"(size / 4), "1"(to), "2"(from) \
: "memory"); \
+ if (current->need_resched) schedule(); \
} while (0)

#define __copy_user_zeroing(to,from,size) \
@@ -298,6 +299,7 @@
: "=&c"(size), "=&D" (__d0), "=&S" (__d1) \
: "r"(size & 3), "0"(size / 4), "1"(to), "2"(from) \
: "memory"); \
+ if (current->need_resched) schedule(); \
} while (0)

/* We let the __ versions of copy_from/to_user inline, because they're often
@@ -338,6 +340,7 @@
: "=c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
+ if (current->need_resched) schedule(); \
break; \
case 1: \
__asm__ __volatile__( \
@@ -428,6 +431,7 @@
: "=c"(size), "=&S" (__d0), "=&D" (__d1)\
: "1"(from), "2"(to), "0"(size/4) \
: "memory"); \
+ if (current->need_resched) schedule(); \
break; \
case 1: \
__asm__ __volatile__( \
\
 
 \ /
  Last update: 2005-03-22 13:53    [from the cache]
©2003-2011 Jasper Spaans