Re: vm_ops.page_mkwrite() fails with vmalloc on 2.6.23

From: Peter Zijlstra
Date: Tue Oct 30 2007 - 09:12:54 EST


On Tue, 2007-10-30 at 12:39 +0000, Hugh Dickins wrote:
> On Tue, 30 Oct 2007, Stefani Seibold wrote:
> >
> > the question is how can i get all pte's from a vmalloc'ed memory. Due to
> > the zeroed mapping pointer i dont see how to do this?
>
> The mapping pointer is zeroed because you've done nothing to set it.
> Below is how I answered you a week ago. But this is new territory
> (extending page_mkclean to work on more than just pagecache pages),
> I'm still unsure what would be the safest way to do it.

Quite, I think manual usage of page_mkclean_one() on the vma gotten from
mmap() along with properly setting page->index is the simplest solution
to make work.

Making page_mkclean(struct page *) work for remap_pfn/vmalloc_range()
style mmaps would require extending rmap to work with those, which
includes setting page->mapping to point to a anon_vma like object.

But that sounds like a lot of work, and I'm not sure its worth the
overhead, because so far all users of remap_pfn/vmalloc_range() have
survived without.


Attachment: signature.asc
Description: This is a digitally signed message part