Lines Matching refs:p
133 struct task_struct *find_lock_task_mm(struct task_struct *p) in find_lock_task_mm() argument
139 for_each_thread(p, t) { in find_lock_task_mm()
162 static bool oom_unkillable_task(struct task_struct *p) in oom_unkillable_task() argument
164 if (is_global_init(p)) in oom_unkillable_task()
166 if (p->flags & PF_KTHREAD) in oom_unkillable_task()
201 long oom_badness(struct task_struct *p, unsigned long totalpages) in oom_badness() argument
206 if (oom_unkillable_task(p)) in oom_badness()
209 p = find_lock_task_mm(p); in oom_badness()
210 if (!p) in oom_badness()
218 adj = (long)p->signal->oom_score_adj; in oom_badness()
220 test_bit(MMF_OOM_SKIP, &p->mm->flags) || in oom_badness()
221 in_vfork(p)) { in oom_badness()
222 task_unlock(p); in oom_badness()
230 points = get_mm_rss(p->mm) + get_mm_counter(p->mm, MM_SWAPENTS) + in oom_badness()
231 mm_pgtables_bytes(p->mm) / PAGE_SIZE; in oom_badness()
232 task_unlock(p); in oom_badness()
371 struct task_struct *p; in select_bad_process() local
374 for_each_process(p) in select_bad_process()
375 if (oom_evaluate_task(p, oc)) in select_bad_process()
381 static int dump_task(struct task_struct *p, void *arg) in dump_task() argument
386 if (oom_unkillable_task(p)) in dump_task()
390 if (!is_memcg_oom(oc) && !oom_cpuset_eligible(p, oc)) in dump_task()
393 task = find_lock_task_mm(p); in dump_task()
431 struct task_struct *p; in dump_tasks() local
434 for_each_process(p) in dump_tasks()
435 dump_task(p, oc); in dump_tasks()
452 static void dump_header(struct oom_control *oc, struct task_struct *p) in dump_header() argument
470 if (p) in dump_header()
471 dump_oom_summary(oc, p); in dump_header()
488 bool process_shares_mm(struct task_struct *p, struct mm_struct *mm) in process_shares_mm() argument
492 for_each_thread(p, t) { in process_shares_mm()
870 struct task_struct *p; in task_will_free_mem() local
900 for_each_process(p) { in task_will_free_mem()
901 if (!process_shares_mm(p, mm)) in task_will_free_mem()
903 if (same_thread_group(task, p)) in task_will_free_mem()
905 ret = __task_will_free_mem(p); in task_will_free_mem()
916 struct task_struct *p; in __oom_kill_process() local
920 p = find_lock_task_mm(victim); in __oom_kill_process()
921 if (!p) { in __oom_kill_process()
926 } else if (victim != p) { in __oom_kill_process()
927 get_task_struct(p); in __oom_kill_process()
929 victim = p; in __oom_kill_process()
966 for_each_process(p) { in __oom_kill_process()
967 if (!process_shares_mm(p, mm)) in __oom_kill_process()
969 if (same_thread_group(p, victim)) in __oom_kill_process()
971 if (is_global_init(p)) { in __oom_kill_process()
976 task_pid_nr(p), p->comm); in __oom_kill_process()
983 if (unlikely(p->flags & PF_KTHREAD)) in __oom_kill_process()
985 do_send_sig_info(SIGKILL, SEND_SIG_PRIV, p, PIDTYPE_TGID); in __oom_kill_process()
1200 struct task_struct *p; in SYSCALL_DEFINE2() local
1216 p = find_lock_task_mm(task); in SYSCALL_DEFINE2()
1217 if (!p) { in SYSCALL_DEFINE2()
1222 mm = p->mm; in SYSCALL_DEFINE2()
1225 if (task_will_free_mem(p)) in SYSCALL_DEFINE2()
1232 task_unlock(p); in SYSCALL_DEFINE2()