Re: question on memory map cleanup stuff

William Lee Irwin III
2004-10-19T18:28:36Z

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