• Paolo 'Blaisorblade' Giarrusso's avatar
    [PATCH] uml: fixes performance regression in activate_mm and thus exec() · 1e40cd38
    Paolo 'Blaisorblade' Giarrusso authored
    Normally, activate_mm() is called from exec(), and thus it used to be a
    no-op because we use a completely new "MM context" on the host (for
    instance, a new process), and so we didn't need to flush any "TLB entries"
    (which for us are the set of memory mappings for the host process from the
    virtual "RAM" file).
    
    Kernel threads, instead, are usually handled in a different way.  So, when
    for AIO we call use_mm(), things used to break and so Benjamin implemented
    activate_mm().  However, that is only needed for AIO, and could slow down
    exec() inside UML, so be smart: detect being called for AIO (via
    PF_BORROWED_MM) and do the full flush only in that situation.
    
    Comment also the caller so that people won't go breaking UML without
    noticing.  I also rely on the caller's locks for testing current->flags.
    Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
    CC: Benjamin LaHaise <bcrl@kvack.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    1e40cd38
aio.c 43.7 KB