Re: [linux-audio-dev] oh well, so much for mlock/mmap

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

Subject: Re: [linux-audio-dev] oh well, so much for mlock/mmap
From: Erik de Castro Lopo (erikd_AT_zip.com.au)
Date: Wed Apr 05 2000 - 12:20:39 EEST


Paul Barton-Davis wrote:
>
> >> I wrote two test programs (see below). One of them uses mlock/mmap to
> >> step through 24 files, locking their data into RAM in 256kB chunks.
> >> The other uses pread(2) to copy data into an mlocked buffer.
> >>
> >> The mmap/mlock version takes 3 times as long as the pread version.
> >
> >Did you try doing this without the mlock? Without mlock() you will
> >need to read at least a byte from each page.
>
> Yep, been there, done that. The problem with not having mlock is that
> some of the read-ahead data can get paged out. Bad news when we come
> to copy it into the audio h/w buffer. In fact, more than bad news -
> it causes a drop out.
>
> >What kind of disks are you using? Its my understanding that IDE
> >don't work all that well.
>
> Ultra2 SCSI, 80MB/sec, 5.2 and 7.5 and 4.5ms seek times.

You'll find that 80MB/sec is the theroetical maximum of the
cable. IIRC there is no disk that will even come close to this.
About 40?MB/sec is the current max.

> OK, I'll try some variations on the experiment to see if I can get
> close to this. But keep in mind that data rates are not the only
> bottom line here - seek+read times are key.

I agree completely, but if it could avaerage this rate over a 40
second period ont 256k blocks, then seeks could not have been
too much of a factor.

> Still, if you could get
> this performance, then there must be some variation on what happens in
> my test cases that could help.

I found that the perfromance varied greatly with very minor changes
to the code. If anyone is interested I could clean it up somewhat,
write a shell script to generate the dummy files and put it up on
a web page.

Cheers,
Erik

-- 
+-------------------------------------------------+
     Erik de Castro Lopo     erikd_AT_zip.com.au
+-------------------------------------------------+
"Having a firewall that allows NFS to the Internet is like having a 
seat belt that lets your head touch the dashboard." -- Marcus Ranum


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

This archive was generated by hypermail 2b28 : Wed Apr 05 2000 - 12:51:20 EEST