Lines Matching refs:procp
448 struct proc *procp; in pid_lookup() local
450 for (procp = pidhash[pid_hashfn(pid)]; procp && procp->pid != pid; in pid_lookup()
451 procp = procp->pidhash_next) in pid_lookup()
454 return procp; in pid_lookup()
480 static void proc_slot(struct proc *procp) { in proc_slot() argument
481 int adjslot = ADJTOSLOT(procp->oomadj); in proc_slot()
483 adjslot_insert(&procadjslot_list[adjslot], &procp->asl); in proc_slot()
486 static void proc_unslot(struct proc *procp) { in proc_unslot() argument
487 adjslot_remove(&procp->asl); in proc_unslot()
490 static void proc_insert(struct proc *procp) { in proc_insert() argument
491 int hval = pid_hashfn(procp->pid); in proc_insert()
493 procp->pidhash_next = pidhash[hval]; in proc_insert()
494 pidhash[hval] = procp; in proc_insert()
495 proc_slot(procp); in proc_insert()
500 struct proc *procp; in pid_remove() local
503 for (procp = pidhash[hval], prevp = NULL; procp && procp->pid != pid; in pid_remove()
504 procp = procp->pidhash_next) in pid_remove()
505 prevp = procp; in pid_remove()
507 if (!procp) in pid_remove()
511 pidhash[hval] = procp->pidhash_next; in pid_remove()
513 prevp->pidhash_next = procp->pidhash_next; in pid_remove()
515 proc_unslot(procp); in pid_remove()
516 free(procp); in pid_remove()
555 struct proc *procp; in cmd_procprio() local
631 procp = pid_lookup(params.pid); in cmd_procprio()
632 if (!procp) { in cmd_procprio()
633 procp = malloc(sizeof(struct proc)); in cmd_procprio()
634 if (!procp) { in cmd_procprio()
639 procp->pid = params.pid; in cmd_procprio()
640 procp->uid = params.uid; in cmd_procprio()
641 procp->oomadj = params.oomadj; in cmd_procprio()
642 proc_insert(procp); in cmd_procprio()
644 proc_unslot(procp); in cmd_procprio()
645 procp->oomadj = params.oomadj; in cmd_procprio()
646 proc_slot(procp); in cmd_procprio()
667 struct proc *procp; in cmd_procpurge() local
680 procp = pidhash[i]; in cmd_procpurge()
681 while (procp) { in cmd_procpurge()
682 next = procp->pidhash_next; in cmd_procpurge()
683 free(procp); in cmd_procpurge()
684 procp = next; in cmd_procpurge()
1332 static int kill_one_process(struct proc* procp, int min_oom_score) { in kill_one_process() argument
1333 int pid = procp->pid; in kill_one_process()
1334 uid_t uid = procp->uid; in kill_one_process()
1375 inc_killcnt(procp->oomadj); in kill_one_process()
1376 ALOGE("Kill '%s' (%d), uid %d, oom_adj %d to free %ldkB", taskname, pid, uid, procp->oomadj, in kill_one_process()
1390 procp->oomadj, mem_st.pgfault, mem_st.pgmajfault, mem_st.rss_in_bytes, in kill_one_process()
1394 stats_write_lmk_kill_occurred(log_ctx, LMK_KILL_OCCURRED, uid, taskname, procp->oomadj, in kill_one_process()
1424 struct proc *procp; in find_and_kill_process() local
1427 procp = kill_heaviest_task ? in find_and_kill_process()
1430 if (!procp) in find_and_kill_process()
1433 killed_size = kill_one_process(procp, min_score_adj); in find_and_kill_process()