Lines Matching refs:oc
125 static inline bool is_sysrq_oom(struct oom_control *oc) in is_sysrq_oom() argument
127 return oc->order == -1; in is_sysrq_oom()
208 static enum oom_constraint constrained_alloc(struct oom_control *oc, in constrained_alloc() argument
213 enum zone_type high_zoneidx = gfp_zone(oc->gfp_mask); in constrained_alloc()
220 if (!oc->zonelist) in constrained_alloc()
227 if (oc->gfp_mask & __GFP_THISNODE) in constrained_alloc()
235 if (oc->nodemask && in constrained_alloc()
236 !nodes_subset(node_states[N_MEMORY], *oc->nodemask)) { in constrained_alloc()
238 for_each_node_mask(nid, *oc->nodemask) in constrained_alloc()
244 for_each_zone_zonelist_nodemask(zone, z, oc->zonelist, in constrained_alloc()
245 high_zoneidx, oc->nodemask) in constrained_alloc()
246 if (!cpuset_zone_allowed(zone, oc->gfp_mask)) in constrained_alloc()
258 static enum oom_constraint constrained_alloc(struct oom_control *oc, in constrained_alloc() argument
266 enum oom_scan_t oom_scan_process_thread(struct oom_control *oc, in oom_scan_process_thread() argument
269 if (oom_unkillable_task(task, NULL, oc->nodemask)) in oom_scan_process_thread()
277 if (!is_sysrq_oom(oc)) in oom_scan_process_thread()
290 if (task_will_free_mem(task) && !is_sysrq_oom(oc)) in oom_scan_process_thread()
300 static struct task_struct *select_bad_process(struct oom_control *oc, in select_bad_process() argument
311 switch (oom_scan_process_thread(oc, p, totalpages)) { in select_bad_process()
324 points = oom_badness(p, NULL, oc->nodemask, totalpages); in select_bad_process()
386 static void dump_header(struct oom_control *oc, struct task_struct *p, in dump_header() argument
391 current->comm, oc->gfp_mask, oc->order, in dump_header()
400 dump_tasks(memcg, oc->nodemask); in dump_header()
509 void oom_kill_process(struct oom_control *oc, struct task_struct *p, in oom_kill_process() argument
535 dump_header(oc, p, memcg); in oom_kill_process()
556 child_points = oom_badness(child, memcg, oc->nodemask, in oom_kill_process()
628 void check_panic_on_oom(struct oom_control *oc, enum oom_constraint constraint, in check_panic_on_oom() argument
643 if (is_sysrq_oom(oc)) in check_panic_on_oom()
645 dump_header(oc, NULL, memcg); in check_panic_on_oom()
673 bool out_of_memory(struct oom_control *oc) in out_of_memory() argument
707 constraint = constrained_alloc(oc, &totalpages); in out_of_memory()
709 oc->nodemask = NULL; in out_of_memory()
710 check_panic_on_oom(oc, constraint, NULL); in out_of_memory()
713 !oom_unkillable_task(current, NULL, oc->nodemask) && in out_of_memory()
716 oom_kill_process(oc, current, 0, totalpages, NULL, in out_of_memory()
721 p = select_bad_process(oc, &points, totalpages); in out_of_memory()
723 if (!p && !is_sysrq_oom(oc)) { in out_of_memory()
724 dump_header(oc, NULL, NULL); in out_of_memory()
728 oom_kill_process(oc, p, points, totalpages, NULL, in out_of_memory()
746 struct oom_control oc = { in pagefault_out_of_memory() local
759 if (!out_of_memory(&oc)) { in pagefault_out_of_memory()