[lkml]   [2003]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC][PATCH] vm_operation to avoid pagefault/inval race
On Sat, May 17, 2003 at 12:49:48PM -0700, Andrew Morton wrote:
> Daniel Phillips <> wrote:
> >
> > and the only problem is, we have to change pretty well every
> > filesystem in and out of tree.
> But it's only a one-liner per fs.

So the general idea is to do something as follows, right?
(Sorry for not just putting together a patch -- I want
to make sure I understand all of your advice first!)

o Make all callers to do_no_page() instead call

o Make a function, perhaps named something like
install_new_page(), that does the PTE-installation
and RSS-adjustment tasks currently performed by
both do_no_page() and by do_anonymous_page().
(Not clear to me yet whether a full merge of
these two functions is the right approach, more
thought needed. Note that the nopage function
is implicitly aware of whether it is handling
an anonymous page or not, so a pair of functions
that both call another function containing the
common code is reasonable, if warranted.)

The install_new_page() function needs an additional
argument to accept the new_page value that used
to be returned by the nopage() function.

o Add arguments to nopage() to allow it to invoke

o Change all nopage() functions to invoke install_new_page(),
but only in cases where they would -not- return
VM_FAULT_OOM or VM_FAULT_SIGBUS. In these cases,
these two return codes must be handed back to the
caller without invoking install_new_page().

o Otherwise, the value that these nopage() functions
would normally return must be passed to
install_new_page(), and the value returned by
install_new_page() must be returned to the nopage()
function's caller.

o Replace all occurrences of "->vm_ops = NULL" with
"->vm_ops = anonymous_vm_ops" or some such.

o The anonymous_vm_ops would have the following members:

nopage: pointer to a function containing the page-allocation
code extracted from do_anonymous_page(), followed
by a call to install_new_page().

populate: NULL.

open: NULL.

close: NULL.


Thanx, Paul
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-03-22 13:35    [W:0.031 / U:3.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site