From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Andrew Morton <akpm@digeo.com>
Cc: Daniel Phillips <phillips@arcor.de>,
hch@infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] vm_operation to avoid pagefault/inval race
Date: Mon, 19 May 2003 18:23:05 -0700 [thread overview]
Message-ID: <20030519182305.C1813@us.ibm.com> (raw)
In-Reply-To: <20030517124948.6394ded6.akpm@digeo.com>
On Sat, May 17, 2003 at 12:49:48PM -0700, Andrew Morton wrote:
> Daniel Phillips <phillips@arcor.de> 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
vma->vm_ops->nopage().
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
install_new_page().
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.
Thoughts?
Thanx, Paul
next prev parent reply other threads:[~2003-05-20 2:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-17 18:21 [RFC][PATCH] vm_operation to avoid pagefault/inval race Daniel Phillips
2003-05-17 19:49 ` Andrew Morton
2003-05-20 1:23 ` Paul E. McKenney [this message]
2003-05-20 8:11 ` Andrew Morton
2003-05-23 14:35 ` [RFC][PATCH] Avoid vmtruncate/mmap-page-fault race Paul E. McKenney
2003-05-23 16:21 ` Hugh Dickins
2003-05-23 17:10 ` Daniel Phillips
2003-05-23 17:47 ` Hugh Dickins
-- strict thread matches above, loose matches on Subject: below --
2003-05-13 20:53 [RFC][PATCH] vm_operation to avoid pagefault/inval race Paul E. McKenney
2003-05-17 16:06 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030519182305.C1813@us.ibm.com \
--to=paulmck@us.ibm.com \
--cc=akpm@digeo.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=phillips@arcor.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).