linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Nick Piggin <npiggin@suse.de>,
	Linux Memory Management <linux-mm@kvack.org>,
	Andrew Morton <akpm@osdl.org>, Jes Sorensen <jes@sgi.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: ptrace and pfn mappings
Date: Tue, 10 Oct 2006 19:06:32 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610101827130.14815@blonde.wat.veritas.com> (raw)
In-Reply-To: <20061010123128.GA23775@infradead.org>

On Tue, 10 Oct 2006, Christoph Hellwig wrote:
> On Tue, Oct 10, 2006 at 11:16:27AM +1000, Benjamin Herrenschmidt wrote:
> > 
> > The "easy" way out I can see, but it may have all sort of bad side
> > effects I haven't thought about at this point, is to switch the mm in
> > access_process_vm (at least if it's hitting such a VMA).
> 
> Switching the mm is definitly no acceptable.  Too many things could
> break when violating the existing assumptions.

I disagree.  Ben's switch-mm approach deserves deeper examination than
that.  It's both simple and powerful.  And it's already done by AIO's
use_mm - the big differences being, of course, that the kthread has
no original mm of its own, and it's limited in what it gets up to.

What would be the actual problems with ptrace temporarily adopting
another's mm?  What are our existing assumptions?

We do already have the minor issue that expand_stack uses the wrong
task's rlimits (there was a patch for that, perhaps Nick's fault
struct would help make it less intrusive to fix - I was put off
it by having to pass an additional arg down so many levels).

> I think the best idea is to add a new ->access method to the vm_operations
> that's called by access_process_vm() when it exists and VM_IO or VM_PFNMAP
> are set.   ->access would take the required object locks and copy out the
> data manually.  This should work both for spufs and drm.

I find Ben's idea more appealing; but agree it _may_ prove unworkable.

Hugh

--
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>

  parent reply	other threads:[~2006-10-10 18:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09 16:12 [rfc] 2.6.19-rc1-git5: consolidation of file backed fault handlers Nick Piggin
2006-10-09 16:12 ` [patch 1/5] mm: fault vs invalidate/truncate check Nick Piggin
2006-10-09 16:12 ` [patch 2/5] mm: fault vs invalidate/truncate race fix Nick Piggin
2006-10-09 21:10   ` Mark Fasheh
2006-10-10  1:10     ` Nick Piggin
2006-10-11 18:34       ` Mark Fasheh
2006-10-12  3:28         ` Nick Piggin
2006-10-09 16:12 ` [patch 3/5] mm: fault handler to replace nopage and populate Nick Piggin
2006-10-09 16:12 ` [patch 4/5] mm: add vm_insert_pfn helpler Nick Piggin
2006-10-09 21:03   ` Benjamin Herrenschmidt
2006-10-10  0:42     ` Nick Piggin
2006-10-10  1:11       ` faults and signals Benjamin Herrenschmidt
2006-10-10  1:20         ` Nick Piggin
2006-10-10  1:58           ` Benjamin Herrenschmidt
2006-10-10  2:00             ` Benjamin Herrenschmidt
2006-10-10  2:04               ` Nick Piggin
2006-10-10  2:07                 ` Benjamin Herrenschmidt
2006-10-10  1:16       ` ptrace and pfn mappings Benjamin Herrenschmidt
2006-10-10  2:23         ` Nick Piggin
2006-10-10  2:47           ` Benjamin Herrenschmidt
2006-10-10  2:56             ` Benjamin Herrenschmidt
2006-10-10  3:03               ` Nick Piggin
2006-10-10  3:42                 ` Benjamin Herrenschmidt
2006-10-10  2:58             ` Nick Piggin
2006-10-10  3:40               ` Benjamin Herrenschmidt
2006-10-10  3:46                 ` Nick Piggin
2006-10-10  4:58                   ` Benjamin Herrenschmidt
2006-10-10 12:31         ` Christoph Hellwig
2006-10-10 12:42           ` Benjamin Herrenschmidt
2006-10-10 18:06           ` Hugh Dickins [this message]
2006-10-09 16:13 ` [patch 5/5] mm: merge nopfn with fault handler Nick Piggin
2006-10-09 20:57 ` [rfc] 2.6.19-rc1-git5: consolidation of file backed fault handlers Benjamin Herrenschmidt
2006-10-09 21:00   ` Benjamin Herrenschmidt
2006-10-10  0:53     ` Nick Piggin

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=Pine.LNX.4.64.0610101827130.14815@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=hch@infradead.org \
    --cc=jes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=npiggin@suse.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