summaryrefslogtreecommitdiffstats
path: root/mm/oom_kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/oom_kill.c')
-rw-r--r--mm/oom_kill.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index f6d4ae9f1c69..1a21819a8e5e 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -680,7 +680,7 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
680 unsigned int victim_points = 0; 680 unsigned int victim_points = 0;
681 static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL, 681 static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL,
682 DEFAULT_RATELIMIT_BURST); 682 DEFAULT_RATELIMIT_BURST);
683 bool can_oom_reap = true; 683 bool can_oom_reap;
684 684
685 /* 685 /*
686 * If the task is already exiting, don't alarm the sysadmin or kill 686 * If the task is already exiting, don't alarm the sysadmin or kill
@@ -742,6 +742,10 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p,
742 /* Get a reference to safely compare mm after task_unlock(victim) */ 742 /* Get a reference to safely compare mm after task_unlock(victim) */
743 mm = victim->mm; 743 mm = victim->mm;
744 atomic_inc(&mm->mm_count); 744 atomic_inc(&mm->mm_count);
745
746 /* Make sure we do not try to oom reap the mm multiple times */
747 can_oom_reap = !test_and_set_bit(MMF_OOM_KILLED, &mm->flags);
748
745 /* 749 /*
746 * We should send SIGKILL before setting TIF_MEMDIE in order to prevent 750 * We should send SIGKILL before setting TIF_MEMDIE in order to prevent
747 * the OOM victim from depleting the memory reserves from the user 751 * the OOM victim from depleting the memory reserves from the user