diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-um/mmu_context.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h index 095bb627b96a..2edb4f1f789c 100644 --- a/include/asm-um/mmu_context.h +++ b/include/asm-um/mmu_context.h | |||
@@ -20,7 +20,15 @@ extern void force_flush_all(void); | |||
20 | 20 | ||
21 | static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) | 21 | static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) |
22 | { | 22 | { |
23 | if (old != new) | 23 | /* |
24 | * This is called by fs/exec.c and fs/aio.c. In the first case, for an | ||
25 | * exec, we don't need to do anything as we're called from userspace | ||
26 | * and thus going to use a new host PID. In the second, we're called | ||
27 | * from a kernel thread, and thus need to go doing the mmap's on the | ||
28 | * host. Since they're very expensive, we want to avoid that as far as | ||
29 | * possible. | ||
30 | */ | ||
31 | if (old != new && (current->flags & PF_BORROWED_MM)) | ||
24 | force_flush_all(); | 32 | force_flush_all(); |
25 | } | 33 | } |
26 | 34 | ||