From: Oleg Nesterov <oleg@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Andi Kleen <andi@firstfloor.org>, Borislav Petkov <bp@alien8.de>,
Hugh Dickins <hughd@google.com>, Ingo Molnar <mingo@kernel.org>,
Jiri Kosina <jkosina@suse.cz>,
Peter Zijlstra <peterz@infradead.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/1] uprobes: Kill __replace_page(), change uprobe_write_opcode() to rely on gup(WRITE)
Date: Tue, 10 Dec 2013 22:24:09 +0100 [thread overview]
Message-ID: <20131210212409.GA3179@redhat.com> (raw)
In-Reply-To: <CA+55aFyWtF762kRv4FyYS7E9sKtuFiEJZ87JudN55xHaBvwAQg@mail.gmail.com>
On 12/10, Linus Torvalds wrote:
>
> On Tue, Dec 10, 2013 at 12:04 PM, Oleg Nesterov <oleg@redhat.com> wrote:
> >> We'd be *much* better off using get_user_pages_fast() if possible -
> >> and I bet _is_ possible in 99% of all cases.
> >
> > We can't. get_user_pages_fast() takes mmap_sem.
>
> Yeah, and we need to look up the page table entry anyway, so what we
> actually want here is just the page table walker,
Yes, this is clear.
And damn, somehow I forgot that _fast() can (obviously) only use
current->mm.
> none of the "get
> page" crap at all.
>
> So the core function should (I think) just do something like:
I'll try to think, but this is what I actually tried to avoid.
I mean,
> Put another way: I actually think the existing "__replace_page()" code
> is closer to being good than that disgusting uprobe_write_opcode()
> function. I think you may be getting rid of the wrong ugly function.
And perhaps you are right.
But my only motivation was: rely on gup() to simplify this code. Yes,
gup() is slow, but it works and we can avoid the "nontrivial" things
like page_remove_rmap/munlock_vma_page.
If we want to optimize this code, then this patch obviously goes to
the wrong direction, I agree.
Oleg.
next prev parent reply other threads:[~2013-12-10 21:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-09 21:18 [PATCH 0/1] uprobes: Kill __replace_page(), change uprobe_write_opcode() to rely on gup(WRITE) Oleg Nesterov
2013-12-09 21:18 ` [PATCH 1/1] " Oleg Nesterov
2013-12-10 2:08 ` [PATCH 0/1] " Linus Torvalds
2013-12-10 19:18 ` Oleg Nesterov
2013-12-10 19:38 ` Linus Torvalds
2013-12-10 20:04 ` Oleg Nesterov
2013-12-10 20:16 ` Linus Torvalds
2013-12-10 21:24 ` Oleg Nesterov [this message]
2013-12-10 20:16 ` Oleg Nesterov
2013-12-10 20:19 ` 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=20131210212409.GA3179@redhat.com \
--to=oleg@redhat.com \
--cc=ananth@in.ibm.com \
--cc=andi@firstfloor.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=srikar@linux.vnet.ibm.com \
--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