Re: question on memory map cleanup stuff

Chris Friesen
2004-10-19T19:04:45Z

> On Mon, Oct 18, 2004 at 04:57:20PM -0600, Chris Friesen wrote:
>
>>I've got a small feature that maps a page of kernel memory to userspace via
>>a syscall, then uses that page for various things.
>>Currently, I'm marking the page reserved, then exporting it via
>>remap_page_range(). This means that I need to clean up my mapping whenever
>>the memory map is destroyed (process death, exec(), daemonize, etc.).

> vma->vm_ops->close() often suffices for such without disturbing the core.

I'm running into a problem.

At the time of close(), I need to figure out which page to unreserve and free.
However, when I call

follow_page(vma->vm_mm, vma->vm_start, 0);

it returns zero. How do I go from vma to page?

Chris