[lkml]   [2005]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Add notification of page becoming writable to VMA ops
Hugh Dickins <> wrote:

> > + if (vma->vm_ops->page_mkwrite &&
> > + vma->vm_ops->page_mkwrite(vma, new_page) < 0)
> > + return VM_FAULT_SIGBUS;
> > + }
> > }
> This isn't necessarily wrong, and may be exactly how it was before,
> I don't remember. But it implies that when page_mkwrite fails,
> it page_cache_releases the page. Is that desirable? Or should
> that be left to the caller?

You're right. I've added a release. That may explain a memory leak I was
seeing that I couldn't find.

> > @@ -1945,7 +1998,7 @@ static int do_file_page(struct mm_struct
> Drop all those changes to do_file_page (which I added), they're no
> longer necessary. A case appeared which made it clear that we cannot
> rely on resolving this issue for get_user_pages in a single call to
> handle_mm_fault, and that's why the VM_FAULT_WRITE stuff got added.

I take it then that:

(1) the write_access parameter to do_file_page() is there purely so that
handle_pte_fault() can jump to it rather than calling it since they have
the same parameter set and return value;

(2) and that do_file_page() always installs a read-only PTE so that
do_wp_page() will be called subsequently on a write attempt.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-10-25 12:15    [W:0.084 / U:4.584 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site