Messages in this thread | | | Date | Tue, 10 Dec 2013 12:19:23 -0800 | Subject | Re: [PATCH 0/1] uprobes: Kill __replace_page(), change uprobe_write_opcode() to rely on gup(WRITE) | From | Linus Torvalds <> |
| |
On Tue, Dec 10, 2013 at 12:16 PM, Oleg Nesterov <oleg@redhat.com> wrote: > On 12/10, Oleg Nesterov wrote: >> >> On 12/10, Linus Torvalds 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. > > Hmm. I am stupid, there is __get_user_pages_fast(). OK, I'll try > to think more.
There is indeed the non-locking version, however, since we want to get the pte-pointer anyway, I really think you were right in complaining about get_user_pages_fast() in the first place, and we'd be much better off just doing the page table lookup ourselves. Which we have to do later *anyway*.
The whole [__]get_user_pages[_fast]() family of functions are for people who want the *page*. We want more than that. We really want the page table entry, since we have to potentially change it.
Linus
| |