Re: [linux-audio-dev] Re: more bad low latency results

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Re: more bad low latency results
From: Takashi Iwai (tiwai_AT_suse.de)
Date: Wed Nov 14 2001 - 14:46:43 EET


Hi,

At Wed, 14 Nov 2001 11:40:35 +0100,
Maarten de Boer wrote:
>
> I did not get any reaction on one of my previous mails, so I send it
> again. There have been numerous reports on this list about good LL,
> and now I find it very frustrating I can not get it myself. Please
> help me out! I'd really hate the get the impression that the whole
> LL issue is still unreal.
>
> > Since with AMD Athlon I get either bad low latency (compiling for AMD)
> > or bad sound quality (if I compile for 386. really don't understand why..),
> > I now did some tests on a Pentium III. The results are still not good:
> >
> > kernel 2.4.14 low latency patch a Pentium III 800 Mhz,
> >
> > http://193.145.55.36/latencytest/2.4.14-LL-PIII/3x256.html
> >
> > I am getting really disappointed. It's no fun to compile
> > kernels and alsa with different configurations lots of time only
> > to get bad results.
> >
> > What kernels are you guys running? What would be the safest bet?
> > On what processor? I really want it to work well on the AMD Athlon.
> > Anybody using an AMD Athlon and has good LL results?

Hmm, I'm using an Athlon 600 MHz and got promising results even with
it. You can find the results (on different conditions) under
        http://alsa-project.org/~iwai/latency-results/2.4.12
The result with all LL-patches is found in ll-all directory.

The kernel was based on SuSE's 2.4.12, which is mostly equivalent with
AA-patch. FS is reiserfs. Compiled with ARCH_M586.

The tests were harder than normal cases, since I ran find / in
background together with the normal stress tests.

I guess Andrew's LL patch misses resched checks in two long loops with
lru lock in fs/buffer.c. One is like this:

================================================================
--- linux-2.4.13.SuSE/fs/buffer.c Mon Oct 29 14:13:58 2001
+++ linux-2.4.13.SuSE+LL/fs/buffer.c Wed Oct 31 16:03:22 2001
@@ -259,7 +259,11 @@ static int wait_for_buffers(kdev_t dev,
         while (next && --nr >= 0) {
                 struct buffer_head *bh = next;
                 next = bh->b_next_free;
-
+ if (conditional_schedule_needed()) {
+ spin_unlock(&lru_list_lock);
+ unconditional_schedule();
+ return -EAGAIN;
+ }
                 if (!buffer_locked(bh)) {
                         if (refile)
                                 __refile_buffer(bh);
================================================================

and more checks are already included in Andrea's tree.
I'm not sure vanilla 2.4.14 has it (perhaps not?). Here goes:

================================================================
diff -urN 2.4.13pre3/fs/buffer.c sched/fs/buffer.c
--- 2.4.13pre3/fs/buffer.c Tue Oct 16 02:03:44 2001
+++ sched/fs/buffer.c Wed Oct 17 23:40:56 2001
@@ -231,6 +231,7 @@
 static void write_unlocked_buffers(kdev_t dev)
 {
        do {
+ conditional_schedule();
                spin_lock(&lru_list_lock);
        } while (write_some_buffers(dev));
        run_task_queue(&tq_disk);
@@ -280,6 +281,7 @@
 static int wait_for_locked_buffers(kdev_t dev, int index, int refile)
 {
        do {
+ conditional_schedule();
                spin_lock(&lru_list_lock);
        } while (wait_for_buffers(dev, index, refile));
        return 0;
================================================================

Takashi


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Wed Nov 14 2001 - 14:41:35 EET