From: Nick Piggin <npiggin@suse.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [patch 3/8] mm: merge nopfn into fault
Date: Thu, 24 May 2007 03:42:23 +0200 [thread overview]
Message-ID: <20070524014223.GA22998@wotan.suse.de> (raw)
In-Reply-To: <1179963619.32247.991.camel@localhost.localdomain>
On Thu, May 24, 2007 at 09:40:19AM +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2007-05-18 at 08:23 -0700, Linus Torvalds wrote:
> >
> > If we are changing the calling semantics of "nopage", then we should also
> > remove the horrible, horrible hack of making the "nopfn" function itself
> > do the "populate the page tables".
> >
> > It would be *much* better to just
>
> .../...
>
> > and let the caller always insert the thing into the page tables.
> >
> > Wouldn't it be nice if we never had drivers etc modifying page tables
> > directly? Even with helpers like "vm_insert_pfn()"?
>
> The problem is that this is racy vs. concurrent unmap_mapping_range().
Yeah, I decided against that after replying to Linus. Also, it is just
not a common path that we want to clutter up the core pagefault
handler with. As I said, if the handler already knows about pfns and
specifically doesn't want struct page backings etc etc. (rather than
just looking up pagecache offsets like a filesystem), then we can assume
it has some idea about memory management and I don't think it is
particularly bad to have it install the pte.
So I do *not* want the normal fault path to do some weird nopfn stuff
based on return values of the handler.
At most, if Linus really doesn't want ->fault to do the nopfn thing, then
I would be happy to leave in ->nopfn... but I don't see much reason not
to just merge them anyway... one fewer branch and less code in the
page fault handler.
> As I explained in my previous email, spufs and the DRI are 2 examples
> where we need to expose to userland a mapping whose backing PFN's have
> to be switched between different physical storage.
>
> The only way I've found to have this be race free is to have the
> ->nopfn() function do the actual PTE insertion while holding a
> lock/mutex that is also taken by whatever calles unmap_mapping_range()
> when the switching occurs).
Yep, thanks for the input.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-05-24 1:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-18 7:37 akpm, Nick Piggin
2007-05-18 15:23 ` Linus Torvalds
2007-05-19 1:46 ` Nick Piggin
2007-05-23 23:40 ` Benjamin Herrenschmidt
2007-05-24 1:42 ` Nick Piggin [this message]
2007-05-24 2:04 ` Linus Torvalds
2007-05-24 2:16 ` Nick Piggin
2007-05-24 3:17 ` Benjamin Herrenschmidt
2007-05-24 3:26 ` Benjamin Herrenschmidt
2007-05-24 3:37 ` Linus Torvalds
2007-05-24 3:45 ` Nick Piggin
2007-05-24 10:07 ` Christoph Hellwig
2007-05-24 10:15 ` Benjamin Herrenschmidt
2007-05-24 3:48 ` Benjamin Herrenschmidt
2007-05-25 11:18 ` Nick Piggin
2007-05-25 16:36 ` Linus Torvalds
2007-05-26 7:34 ` Nick Piggin
2007-05-26 8:03 ` Nick Piggin
2007-05-26 15:44 ` Linus Torvalds
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=20070524014223.GA22998@wotan.suse.de \
--to=npiggin@suse.de \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
/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