lkml.org 
[lkml]   [1999]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Sound problems, Scsi CDDA ripping. 2.2+
Date
In article <Pine.LNX.3.96.990222150911.16765A-100000@wookie.chirp.com.au>,
Nathan Hand <nathanh@wookie.chirp.com.au> wrote:
>This sounds like a kludge to fix an IBM-PC brain damage. Rather
>than reserve "special" memory, why not provide a way to reclaim
>a given page of (physical) memory. A module can then force some
>other process to vacate memory below 16MB, and claim it for its
>own purposes. Some sort of flag would be required to indicate a
>valid need for certain (physical) pages, so that a module can't
>force out say another module also using DMA-able memory.
>
>Would the easiest way to do this be to force the physical pages
>into swap, then mark them your own? It wouldn't be fast, but it
>doesn't need to be and I think this change would require fewest
>modifications to the existing code. How could this be done on a
>machine with no swap?

The later 2.1.x kernels seem to do this (warning: I haven't read the
source code, I just have a few thousand hours of experience with sound
card behavior on Linux systems ;-). Somewhere around 2.1.115 there was
a change that made open("/dev/dsp",...) succeed a lot more often. I
think it uses different flags on kmalloc() to cause memory to be swapped
out, but I haven't been following any of the 2.1.xx VM stuff so I'm not
an authority here.

On a machine with 128M of RAM which is dedicated to being mostly disk
cache (i.e. a web server) it is really hard to use the sound drivers
(i.e. to be an audio server as well). I have scripts which do this just
before opening the audio device:

dd obs=120000k < /dev/zero | head -c1

This forces Linux to swap out just about everything. After that there's
_lots_ of free memory. ;-)

I've been using this workaround since 1.3.XX. 2.2.1 still fails if there
is too much 'cached' memory (according to /proc/meminfo). I think it
can swap out anything but buffers in the low 16M or something, because
my workaround still works. Maybe the sound driver is just not aggressive
enough about trying to free memory.

I would appreciate a kernel flag that tells Linux to "_never_ use memory
below 16M and above the BSS of the kernel for any non-swappable data (e.g.
process descriptors, kernel stacks, and page tables, all of which can't
be swapped last time I checked). I have 112 megabytes of RAM available
for such data. Use it."

--
Zygo Blaxell, Linux Engineer, Corel Corporation, zygob@corel.ca (work),
zblaxell@furryterror.org (play). It's my opinion, I tell you! Mine! All MINE!
Size of 'diff -Nurw [...] winehq corel' as of Mon Feb 22 10:14:00 EST 1999
Lines/files: In 2948 / 53, Out 28916 / 427, Both 31134 / 460

-
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:50    [W:0.737 / U:0.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site