Re: mapping user space buffer to kernel address space

From: Andrea Arcangeli (andrea@suse.de)
Date: Thu Oct 19 2000 - 10:09:37 EST


On Wed, Oct 18, 2000 at 10:30:45PM -0400, Jeff Garzik wrote:
> Well coolio. Would somebody be up for sanity checking my audio mmap
> code (attached)? It doesn't look too hard at all to get the audio

Nice patch ;).

> vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */

Since you do vm_falgs |= VM_LOCKED you won't need to implement swapout since
it will never run. (and the VM_SHM there is wrong)
 
The driver will work also this way but it will be slower because it will
generate pagefaults that would be otherwise avoided.

A case where the above would make tons of sense is if the mapped area would
be of the order of gigabytes (or at least houndred of mbytes) where lazily
mapping would avoid a big mmap(/dev/dsp) latency and precious pagetables at
startup.

I just don't think the additional complexity is worthwhile for a sound driver.

However I see it's fun :).

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:15 EST