tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Implement mmap for PUD

On Wed, 7 Sep 2011, Roger Pau Monné wrote:

> Basically we use pud_request to pass the request to the user-space
> server, and the server returns a memory address, allocated in the
> user-space memory of it's process. Then I try to read the value of the
> user space memory from the kernel, which works ok, I can fetch the
> correct value. After reading the value (that is just used for
> debugging), the physical address of the memory region is collected
> using pmap_extract and returned.

I'm not sure you can do this.  The mmap() interface in drivers is designed 
to hand out unmanaged pages, not managed page frames.  Userland processes 
use page frames to hold pages that could be paged out at any time.  You 
could have nasty problems with wiring and reference counts.  What you 
really need to do here is shared memory not a typical device mmap().

WHY do you want to do this?  What is PUD?  Why do you have kernel devices 
backed by userland daemons?  I think a filesystem may be more appropriate 
than a device in this case.


Home | Main Index | Thread Index | Old Index