Skip to content

Commit 299c517

Browse files
rientjestorvalds
authored andcommitted
mm, oom: header nodemask is NULL when cpusets are disabled
Commit 82e7d3a ("oom: print nodemask in the oom report") implicitly sets the allocation nodemask to cpuset_current_mems_allowed when there is no effective mempolicy. cpuset_current_mems_allowed is only effective when cpusets are enabled, which is also printed by dump_header(), so setting the nodemask to cpuset_current_mems_allowed is redundant and prevents debugging issues where ac->nodemask is not set properly in the page allocator. This provides better debugging output since cpuset_print_current_mems_allowed() is already provided. [rientjes@google.com: newline per Hillf] Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1701200158300.88321@chino.kir.corp.google.com Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1701191454470.2381@chino.kir.corp.google.com Signed-off-by: David Rientjes <rientjes@google.com> Suggested-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Mel Gorman <mgorman@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e86c59b commit 299c517

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎mm/oom_kill.c‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,14 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)
403403

404404
static void dump_header(struct oom_control *oc, struct task_struct *p)
405405
{
406-
nodemask_t *nm = (oc->nodemask) ? oc->nodemask : &cpuset_current_mems_allowed;
407-
408-
pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=%*pbl, order=%d, oom_score_adj=%hd\n",
409-
current->comm, oc->gfp_mask, &oc->gfp_mask,
410-
nodemask_pr_args(nm), oc->order,
411-
current->signal->oom_score_adj);
406+
pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=",
407+
current->comm, oc->gfp_mask, &oc->gfp_mask);
408+
if (oc->nodemask)
409+
pr_cont("%*pbl", nodemask_pr_args(oc->nodemask));
410+
else
411+
pr_cont("(null)");
412+
pr_cont(", order=%d, oom_score_adj=%hd\n",
413+
oc->order, current->signal->oom_score_adj);
412414
if (!IS_ENABLED(CONFIG_COMPACTION) && oc->order)
413415
pr_warn("COMPACTION is disabled!!!\n");
414416

@@ -417,7 +419,7 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
417419
if (oc->memcg)
418420
mem_cgroup_print_oom_info(oc->memcg, p);
419421
else
420-
show_mem(SHOW_MEM_FILTER_NODES, nm);
422+
show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask);
421423
if (sysctl_oom_dump_tasks)
422424
dump_tasks(oc->memcg, oc->nodemask);
423425
}

0 commit comments

Comments
 (0)