From 5318609519800617323b5fdb17c1d4fe12c3d794 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Wed, 14 Nov 2012 01:15:19 -0800 Subject: mm, oom: ensure sysrq+f always passes valid zonelist 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 Reviewed-by: Michal Hocko Signed-off-by: Greg Kroah-Hartman --- drivers/tty/sysrq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/tty/sysrq.c') diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 16ee6cee07da..b3c4a250ff86 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -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); -- cgit v1.2.1