mmap device-drivers

Hans Petter Selasky hps at selasky.org
Tue Mar 14 09:15:50 UTC 2017


On 03/14/17 10:09, Manuel Stühn wrote:
> Hi,
> is it possible for a device driver to keep track if there are still
> active mmap() pointers pointing to that device?
>
> Linux does have something like
>
> struct vm_operations_struct vm_ops =
> {
>                 .close = vm_close,
> };
>
> where vm_close gets called when any mmapped pointer goes out of scope and the
> driver can refcount the mappers.
>
> Is there something similar in freebsd?

Hi,

 From what I know from the past, any memory mapped to userspace via MMAP 
can never be freed.

--HPS



More information about the freebsd-hackers mailing list