Merge tag 'v5.8-rc1' into fixes
[linux-2.6-microblaze.git] / mm / oom_kill.c
index 4daedf7..6e94962 100644 (file)
@@ -126,7 +126,7 @@ static bool oom_cpuset_eligible(struct task_struct *tsk, struct oom_control *oc)
 
 /*
  * The process p may have detached its own ->mm while exiting or through
- * use_mm(), but one or more of its subthreads may still have a valid
+ * kthread_use_mm(), but one or more of its subthreads may still have a valid
  * pointer.  Return p, or any of its subthreads with a valid ->mm, with
  * task_lock() held.
  */
@@ -569,7 +569,7 @@ static bool oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
 {
        bool ret = true;
 
-       if (!down_read_trylock(&mm->mmap_sem)) {
+       if (!mmap_read_trylock(mm)) {
                trace_skip_task_reaping(tsk->pid);
                return false;
        }
@@ -577,8 +577,8 @@ static bool oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
        /*
         * MMF_OOM_SKIP is set by exit_mmap when the OOM reaper can't
         * work on the mm anymore. The check for MMF_OOM_SKIP must run
-        * under mmap_sem for reading because it serializes against the
-        * down_write();up_write() cycle in exit_mmap().
+        * under mmap_lock for reading because it serializes against the
+        * mmap_write_lock();mmap_write_unlock() cycle in exit_mmap().
         */
        if (test_bit(MMF_OOM_SKIP, &mm->flags)) {
                trace_skip_task_reaping(tsk->pid);
@@ -600,7 +600,7 @@ static bool oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
 out_finish:
        trace_finish_task_reaping(tsk->pid);
 out_unlock:
-       up_read(&mm->mmap_sem);
+       mmap_read_unlock(mm);
 
        return ret;
 }
@@ -611,7 +611,7 @@ static void oom_reap_task(struct task_struct *tsk)
        int attempts = 0;
        struct mm_struct *mm = tsk->signal->oom_mm;
 
-       /* Retry the down_read_trylock(mmap_sem) a few times */
+       /* Retry the mmap_read_trylock(mm) a few times */
        while (attempts++ < MAX_OOM_REAP_RETRIES && !oom_reap_task_mm(tsk, mm))
                schedule_timeout_idle(HZ/10);
 
@@ -629,7 +629,7 @@ done:
 
        /*
         * Hide this mm from OOM killer because it has been either reaped or
-        * somebody can't call up_write(mmap_sem).
+        * somebody can't call mmap_write_unlock(mm).
         */
        set_bit(MMF_OOM_SKIP, &mm->flags);
 
@@ -898,7 +898,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message)
        /*
         * Kill all user processes sharing victim->mm in other thread groups, if
         * any.  They don't get access to memory reserves, though, to avoid
-        * depletion of all memory.  This prevents mm->mmap_sem livelock when an
+        * depletion of all memory.  This prevents mm->mmap_lock livelock when an
         * oom killed thread cannot exit because it requires the semaphore and
         * its contended by another thread trying to allocate memory itself.
         * That thread will now get access to memory reserves since it has a
@@ -919,8 +919,8 @@ static void __oom_kill_process(struct task_struct *victim, const char *message)
                        continue;
                }
                /*
-                * No use_mm() user needs to read from the userspace so we are
-                * ok to reap it.
+                * No kthead_use_mm() user needs to read from the userspace so
+                * we are ok to reap it.
                 */
                if (unlikely(p->flags & PF_KTHREAD))
                        continue;