Re: question on memory map cleanup stuff

From: Chris Friesen
Date: Tue Oct 19 2004 - 14:14:53 EST


William Lee Irwin III wrote:
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/