Skip to content

Commit

Permalink
mm, oom: ensure sysrq+f always passes valid zonelist
Browse files Browse the repository at this point in the history
With hotpluggable and memoryless nodes, it's possible that node 0 will
not be online, so use the first online node's zonelist rather than
hardcoding node 0 to pass a zonelist with all zones to the oom killer.

Signed-off-by: David Rientjes <rientjes@google.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
David Rientjes authored and Greg Kroah-Hartman committed Nov 16, 2012
1 parent 18e0749 commit 5318609
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ static struct sysrq_key_op sysrq_term_op = {

static void moom_callback(struct work_struct *ignored)
{
out_of_memory(node_zonelist(0, GFP_KERNEL), GFP_KERNEL, 0, NULL, true);
out_of_memory(node_zonelist(first_online_node, GFP_KERNEL), GFP_KERNEL,
0, NULL, true);
}

static DECLARE_WORK(moom_work, moom_callback);
Expand Down

0 comments on commit 5318609

Please sign in to comment.