You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
memcg: print cgroup information when system panics due to panic_on_oom
If kernel panics due to oom, caused by a cgroup reaching its limit, when 'compulsory panic_on_oom' is enabled, then we will only see that the OOM happened because of "compulsory panic_on_oom is enabled" but this doesn't tell the difference between mempolicy and memcg. And dumping system wide information is plain wrong and more confusing. This patch provides the information of the cgroup whose limit triggerred panic Signed-off-by: Balasubramani Vivekanandan <balasubramani_vivekanandan@mentor.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
2a8e700264
commit
2415b9f5cb
+9
-7
@@ -1442,15 +1442,17 @@ void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
|
||||
struct mem_cgroup *iter;
|
||||
unsigned int i;
|
||||
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
mutex_lock(&oom_info_lock);
|
||||
rcu_read_lock();
|
||||
|
||||
pr_info("Task in ");
|
||||
pr_cont_cgroup_path(task_cgroup(p, memory_cgrp_id));
|
||||
pr_cont(" killed as a result of limit of ");
|
||||
if (p) {
|
||||
pr_info("Task in ");
|
||||
pr_cont_cgroup_path(task_cgroup(p, memory_cgrp_id));
|
||||
pr_cont(" killed as a result of limit of ");
|
||||
} else {
|
||||
pr_info("Memory limit reached of cgroup ");
|
||||
}
|
||||
|
||||
pr_cont_cgroup_path(memcg->css.cgroup);
|
||||
pr_cont("\n");
|
||||
|
||||
@@ -1537,7 +1539,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
|
||||
return;
|
||||
}
|
||||
|
||||
check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL);
|
||||
check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL, memcg);
|
||||
totalpages = mem_cgroup_get_limit(memcg) ? : 1;
|
||||
for_each_mem_cgroup_tree(iter, memcg) {
|
||||
struct css_task_iter it;
|
||||
|
||||
Reference in New Issue
Block a user