Lines Matching defs:victim
162 /* return true if the task is not adequate as candidate victim task. */
447 static void dump_oom_victim(struct oom_control *oc, struct task_struct *victim)
454 mem_cgroup_print_oom_context(oc->memcg, victim);
455 pr_cont(",task=%s,pid=%d,uid=%d\n", victim->comm, victim->pid,
456 from_kuid(&init_user_ns, task_uid(victim)));
508 * victim (if that is possible) to help the OOM killer to move on.
672 /* The victim managed to terminate on its own - see exit_mmap */
687 * Give the OOM victim time to exit naturally before invoking the oom_reaping.
751 * mark_oom_victim - mark the given task as OOM victim
788 * exit_oom_victim - note the exit of an OOM victim
828 * current is not killed (possibly due to sharing the victim's memory).
921 static void __oom_kill_process(struct task_struct *victim, const char *message)
927 p = find_lock_task_mm(victim);
929 pr_info("%s: OOM victim %d (%s) is already exiting. Skip killing the task\n",
930 message, task_pid_nr(victim), victim->comm);
931 put_task_struct(victim);
933 } else if (victim != p) {
935 put_task_struct(victim);
936 victim = p;
939 /* Get a reference to safely compare mm after task_unlock(victim) */
940 mm = victim->mm;
949 * in order to prevent the OOM victim from depleting the memory
952 do_send_sig_info(SIGKILL, SEND_SIG_PRIV, victim, PIDTYPE_TGID);
953 mark_oom_victim(victim);
955 message, task_pid_nr(victim), victim->comm, K(mm->total_vm),
959 from_kuid(&init_user_ns, task_uid(victim)),
960 mm_pgtables_bytes(mm) >> 10, victim->signal->oom_score_adj);
961 task_unlock(victim);
964 * Kill all user processes sharing victim->mm in other thread groups, if
976 if (same_thread_group(p, victim))
982 task_pid_nr(victim), victim->comm,
997 queue_oom_reaper(victim);
1000 put_task_struct(victim);
1019 struct task_struct *victim = oc->chosen;
1029 task_lock(victim);
1030 if (task_will_free_mem(victim)) {
1031 mark_oom_victim(victim);
1032 queue_oom_reaper(victim);
1033 task_unlock(victim);
1034 put_task_struct(victim);
1037 task_unlock(victim);
1041 dump_oom_victim(oc, victim);
1047 * Check this out before killing the victim task.
1049 oom_group = mem_cgroup_get_oom_group(victim, oc->memcg);
1051 __oom_kill_process(victim, message);