aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/aio.c2
-rw-r--r--include/linux/sched.h3
-rw-r--r--kernel/fork.c4
3 files changed, 3 insertions, 6 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 0fb3117ddd93..0051fd94b44e 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -586,7 +586,6 @@ static void use_mm(struct mm_struct *mm)
586 struct task_struct *tsk = current; 586 struct task_struct *tsk = current;
587 587
588 task_lock(tsk); 588 task_lock(tsk);
589 tsk->flags |= PF_BORROWED_MM;
590 active_mm = tsk->active_mm; 589 active_mm = tsk->active_mm;
591 atomic_inc(&mm->mm_count); 590 atomic_inc(&mm->mm_count);
592 tsk->mm = mm; 591 tsk->mm = mm;
@@ -610,7 +609,6 @@ static void unuse_mm(struct mm_struct *mm)
610 struct task_struct *tsk = current; 609 struct task_struct *tsk = current;
611 610
612 task_lock(tsk); 611 task_lock(tsk);
613 tsk->flags &= ~PF_BORROWED_MM;
614 tsk->mm = NULL; 612 tsk->mm = NULL;
615 /* active_mm is still 'mm' */ 613 /* active_mm is still 'mm' */
616 enter_lazy_tlb(mm, tsk); 614 enter_lazy_tlb(mm, tsk);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index eec64a4adb9d..0560999eb1db 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1483,7 +1483,6 @@ static inline void put_task_struct(struct task_struct *t)
1483#define PF_EXITING 0x00000004 /* getting shut down */ 1483#define PF_EXITING 0x00000004 /* getting shut down */
1484#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ 1484#define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */
1485#define PF_VCPU 0x00000010 /* I'm a virtual CPU */ 1485#define PF_VCPU 0x00000010 /* I'm a virtual CPU */
1486#define PF_KTHREAD 0x00000020 /* I am a kernel thread */
1487#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ 1486#define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */
1488#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ 1487#define PF_SUPERPRIV 0x00000100 /* used super-user privileges */
1489#define PF_DUMPCORE 0x00000200 /* dumped core */ 1488#define PF_DUMPCORE 0x00000200 /* dumped core */
@@ -1497,7 +1496,7 @@ static inline void put_task_struct(struct task_struct *t)
1497#define PF_KSWAPD 0x00040000 /* I am kswapd */ 1496#define PF_KSWAPD 0x00040000 /* I am kswapd */
1498#define PF_SWAPOFF 0x00080000 /* I am in swapoff */ 1497#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
1499#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ 1498#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
1500#define PF_BORROWED_MM 0x00200000 /* I am a kthread doing use_mm */ 1499#define PF_KTHREAD 0x00200000 /* I am a kernel thread */
1501#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ 1500#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
1502#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ 1501#define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */
1503#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ 1502#define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */
diff --git a/kernel/fork.c b/kernel/fork.c
index 228f80c9155a..eeaec6893b0d 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -474,7 +474,7 @@ EXPORT_SYMBOL_GPL(mmput);
474/** 474/**
475 * get_task_mm - acquire a reference to the task's mm 475 * get_task_mm - acquire a reference to the task's mm
476 * 476 *
477 * Returns %NULL if the task has no mm. Checks PF_BORROWED_MM (meaning 477 * Returns %NULL if the task has no mm. Checks PF_KTHREAD (meaning
478 * this kernel workthread has transiently adopted a user mm with use_mm, 478 * this kernel workthread has transiently adopted a user mm with use_mm,
479 * to do its AIO) is not set and if so returns a reference to it, after 479 * to do its AIO) is not set and if so returns a reference to it, after
480 * bumping up the use count. User must release the mm via mmput() 480 * bumping up the use count. User must release the mm via mmput()
@@ -487,7 +487,7 @@ struct mm_struct *get_task_mm(struct task_struct *task)
487 task_lock(task); 487 task_lock(task);
488 mm = task->mm; 488 mm = task->mm;
489 if (mm) { 489 if (mm) {
490 if (task->flags & PF_BORROWED_MM) 490 if (task->flags & PF_KTHREAD)
491 mm = NULL; 491 mm = NULL;
492 else 492 else
493 atomic_inc(&mm->mm_users); 493 atomic_inc(&mm->mm_users);