]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - mm/oom_kill.c
Merge tag 'asoc-fix-v4.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broon...
[karo-tx-linux.git] / mm / oom_kill.c
index 0e2c925e7826fe302e5db43c5940237f1c6eb0d6..9e8b4f030c1c43cb92da706306e1b9390658af7b 100644 (file)
@@ -490,6 +490,7 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
 
        if (!down_read_trylock(&mm->mmap_sem)) {
                ret = false;
+               trace_skip_task_reaping(tsk->pid);
                goto unlock_oom;
        }
 
@@ -500,9 +501,12 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
         */
        if (!mmget_not_zero(mm)) {
                up_read(&mm->mmap_sem);
+               trace_skip_task_reaping(tsk->pid);
                goto unlock_oom;
        }
 
+       trace_start_task_reaping(tsk->pid);
+
        /*
         * Tell all users of get_user/copy_from_user etc... that the content
         * is no longer stable. No barriers really needed because unmapping
@@ -544,6 +548,7 @@ static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
         * put the oom_reaper out of the way.
         */
        mmput_async(mm);
+       trace_finish_task_reaping(tsk->pid);
 unlock_oom:
        mutex_unlock(&oom_lock);
        return ret;
@@ -615,6 +620,7 @@ static void wake_oom_reaper(struct task_struct *tsk)
        tsk->oom_reaper_list = oom_reaper_list;
        oom_reaper_list = tsk;
        spin_unlock(&oom_reaper_lock);
+       trace_wake_reaper(tsk->pid);
        wake_up(&oom_reaper_wait);
 }
 
@@ -666,6 +672,7 @@ static void mark_oom_victim(struct task_struct *tsk)
         */
        __thaw_task(tsk);
        atomic_inc(&oom_victims);
+       trace_mark_victim(tsk->pid);
 }
 
 /**