aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2007-10-16 04:25:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:59 -0400
commit58c0a4a7864b2dad6da4090813322fcd29a11c92 (patch)
tree239da4074ced93ee6918fdb03e3839ef721191bb
parent37b07e4163f7306aa735a6e250e8d22293e5b8de (diff)
Fix panic of cpu online with memory less node
When a cpu is onlined on memory-less-node box, kernel panics due to touch NULL pointer of pgdat->kswapd. Current kswapd runs only nodes which have memory. So, calling of set_cpus_allowed() is not necessary for memory-less node. This is fix for it. Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/vmscan.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 8fd8ba1c67b4..cb8ad3c6e483 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1694,9 +1694,11 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
1694{ 1694{
1695 pg_data_t *pgdat; 1695 pg_data_t *pgdat;
1696 cpumask_t mask; 1696 cpumask_t mask;
1697 int nid;
1697 1698
1698 if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) { 1699 if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) {
1699 for_each_online_pgdat(pgdat) { 1700 for_each_node_state(nid, N_HIGH_MEMORY) {
1701 pgdat = NODE_DATA(nid);
1700 mask = node_to_cpumask(pgdat->node_id); 1702 mask = node_to_cpumask(pgdat->node_id);
1701 if (any_online_cpu(mask) != NR_CPUS) 1703 if (any_online_cpu(mask) != NR_CPUS)
1702 /* One of our CPUs online: restore mask */ 1704 /* One of our CPUs online: restore mask */