Skip to content

Commit

Permalink
mm, oom: header nodemask is NULL when cpusets are disabled
Browse files Browse the repository at this point in the history
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.

[[email protected]: newline per Hillf]
  Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Rientjes <[email protected]>
Suggested-by: Vlastimil Babka <[email protected]>
Acked-by: Hillf Danton <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rientjes authored and torvalds committed Feb 25, 2017
1 parent e86c59b commit 299c517
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,14 @@ static void dump_tasks(struct mem_cgroup *memcg, const nodemask_t *nodemask)

static void dump_header(struct oom_control *oc, struct task_struct *p)
{
nodemask_t *nm = (oc->nodemask) ? oc->nodemask : &cpuset_current_mems_allowed;

pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=%*pbl, order=%d, oom_score_adj=%hd\n",
current->comm, oc->gfp_mask, &oc->gfp_mask,
nodemask_pr_args(nm), oc->order,
current->signal->oom_score_adj);
pr_warn("%s invoked oom-killer: gfp_mask=%#x(%pGg), nodemask=",
current->comm, oc->gfp_mask, &oc->gfp_mask);
if (oc->nodemask)
pr_cont("%*pbl", nodemask_pr_args(oc->nodemask));
else
pr_cont("(null)");
pr_cont(", order=%d, oom_score_adj=%hd\n",
oc->order, current->signal->oom_score_adj);
if (!IS_ENABLED(CONFIG_COMPACTION) && oc->order)
pr_warn("COMPACTION is disabled!!!\n");

Expand All @@ -417,7 +419,7 @@ static void dump_header(struct oom_control *oc, struct task_struct *p)
if (oc->memcg)
mem_cgroup_print_oom_info(oc->memcg, p);
else
show_mem(SHOW_MEM_FILTER_NODES, nm);
show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask);
if (sysctl_oom_dump_tasks)
dump_tasks(oc->memcg, oc->nodemask);
}
Expand Down

0 comments on commit 299c517

Please sign in to comment.