mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Patch] Fix panic of cpu online with memory less node
@ 2007-09-11 10:19 Yasunori Goto
  0 siblings, 0 replies; only message in thread
From: Yasunori Goto @ 2007-09-11 10:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel ML


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>

---
 mm/vmscan.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: current/mm/vmscan.c
===================================================================
--- current.orig/mm/vmscan.c	2007-09-03 16:36:18.000000000 +0900
+++ current/mm/vmscan.c	2007-09-11 13:02:20.000000000 +0900
@@ -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 */

-- 
Yasunori Goto 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-11 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-11 10:19 [Patch] Fix panic of cpu online with memory less node Yasunori Goto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®