Skip to contentSkip to conversation

Fix panic of cpu online with memory less node

PATCH New Yasunori Goto 1 participant 1 message Sep 11, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 mm/vmscan.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
mm/vmscan.c +3 -1
Index: current/mm/vmscan.c
===================================================================
@@ -1843,9 +1843,11 @@ static int __devinit cpu_callback(struct
 {
 	pg_data_t *pgdat;
 	cpumask_t mask;
+	int nid;
 
 	if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN) {
-		for_each_online_pgdat(pgdat) {
+		for_each_node_state(nid, N_HIGH_MEMORY) {
+			pgdat = NODE_DATA(nid);
 			mask = node_to_cpumask(pgdat->node_id);
 			if (any_online_cpu(mask) != NR_CPUS)
 				/* One of our CPUs online: restore mask */
Signature · 1 line
Yasunori Goto