Re: question on memory map cleanup stuff

From: William Lee Irwin III
Date: Tue Oct 19 2004 - 13:34:17 EST


William Lee Irwin III wrote:
>> vma->vm_ops->close() often suffices for such without disturbing the core.

On Tue, Oct 19, 2004 at 12:19:00PM -0600, Chris Friesen wrote:
> 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?

You generally need to keep track of this yourself, as during ->close()
the pagetables have already been destroyed. linear_page_index() can
tell you the offset into the object the vma maps, but ultimately, you
have to track the pages yourself. vma->vm_private_data can be used to
attach various accounting structures to the vma.


-- wli
-
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/