lkml.org 
[lkml]   [2009]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL] core kernel fixes


On Sun, 21 Jun 2009, Thomas Gleixner wrote:
>
> Hmm. The main reason why we switched to get_user_pages_fast() in the
> futex code is to avoid mmap_sem contention which was observed as a
> real big performance problem especially with those horrible JavaVM
> applications.

Not relevant.

get_user_pages_fast() takes the mmap_sem for the case where it needs to
fault things in too.

So assuming the _only_ reason this thing is called is because we failed
earlier when doing the futex_atomic_op_inuser(), then you're basically
guaranteed that the "fast" case of get_user_pages_fast() is never actually
taken, since we already know that the page tables aren't amenable to an
atomic access.

And as far as I can tell, that is indeed the only case where you use that
'get_user_writeable()' thing. You've had futex_atomic_op_inuser() fail,
and need to repeat. No?

> As a fallout of this we got rid of the private find_vma /
> handle_mm_fault magic (as above) in the futex code which mm folks
> frowned upon for quite a while. Unfortunately we got it wrong :(

Sure. But "get_user_pages_fast()" really is the wrong thing. You're not at
all interested in the user pages. You're interested in making sure that
the page is atomically writable, and nothing else. Right?

Which is why I said that "lock ; addl $0,(mem)" would be a _single_
instruction, and do everything that your "get_user_pages_fast()" hack
would do. If the fault is unlikely, that would be a better operation. I
just don't think the fault is unlikely, I suspect it happens every time.

Linus


\
 
 \ /
  Last update: 2009-10-18 23:28    [W:0.038 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site