2006-08-10 16:50:34

by Ralph Campbell

[permalink] [raw]
Subject: How to revoke mmap mappings

I am looking for suggestions on how a device driver which implements
mmap() similar to the "scullv" example driver can revoke the
mapping. I would like the driver to be able to invalidate
all of the pages faulted in through struct vm_operations_struct.nopage
so that the vmalloc() memory can be freed. If the user process
tries to touch the mmap region afterwards, it will get a SIGBUS
or SIGSEGV.

I looked in mm/memory.c but unmap_mapping_range() and
vmtruncate() require file mappings so I don't think I
can use these.