diff options
-rw-r--r-- | fs/aio.c | 4 | ||||
-rw-r--r-- | include/asm-um/mmu_context.h | 12 |
2 files changed, 3 insertions, 13 deletions
@@ -591,10 +591,6 @@ static void use_mm(struct mm_struct *mm) | |||
591 | atomic_inc(&mm->mm_count); | 591 | atomic_inc(&mm->mm_count); |
592 | tsk->mm = mm; | 592 | tsk->mm = mm; |
593 | tsk->active_mm = mm; | 593 | tsk->active_mm = mm; |
594 | /* | ||
595 | * Note that on UML this *requires* PF_BORROWED_MM to be set, otherwise | ||
596 | * it won't work. Update it accordingly if you change it here | ||
597 | */ | ||
598 | switch_mm(active_mm, mm, tsk); | 594 | switch_mm(active_mm, mm, tsk); |
599 | task_unlock(tsk); | 595 | task_unlock(tsk); |
600 | 596 | ||
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h index 6686fc524ca1..54f42e8b0105 100644 --- a/include/asm-um/mmu_context.h +++ b/include/asm-um/mmu_context.h | |||
@@ -22,16 +22,10 @@ extern void force_flush_all(void); | |||
22 | static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) | 22 | static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) |
23 | { | 23 | { |
24 | /* | 24 | /* |
25 | * This is called by fs/exec.c and fs/aio.c. In the first case, for an | 25 | * This is called by fs/exec.c and sys_unshare() |
26 | * exec, we don't need to do anything as we're called from userspace | 26 | * when the new ->mm is used for the first time. |
27 | * and thus going to use a new host PID. In the second, we're called | ||
28 | * from a kernel thread, and thus need to go doing the mmap's on the | ||
29 | * host. Since they're very expensive, we want to avoid that as far as | ||
30 | * possible. | ||
31 | */ | 27 | */ |
32 | if (old != new && (current->flags & PF_BORROWED_MM)) | 28 | __switch_mm(&new->context.id); |
33 | __switch_mm(&new->context.id); | ||
34 | |||
35 | arch_dup_mmap(old, new); | 29 | arch_dup_mmap(old, new); |
36 | } | 30 | } |
37 | 31 | ||