patch-2.1.34 linux/arch/ppc/mm/init.c

Next file: linux/arch/sparc/Makefile
Previous file: linux/arch/ppc/kernel/irq.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.33/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c
@@ -72,10 +72,10 @@
     total++;
     if (PageReserved(mem_map+i))
       reserved++;
-    else if (!mem_map[i].count)
+    else if (!atomic_read(&mem_map[i].count))
       free++;
     else
-      shared += mem_map[i].count-1;
+      shared += atomic_read(&mem_map[i].count) - 1;
   }
   printk("%lu pages of RAM\n",total);
   printk("%lu free pages\n",free);
@@ -161,7 +161,7 @@
 	  continue;
 	}
       clear_bit(PG_reserved, &mem_map[MAP_NR(tmp)].flags);
-      mem_map[MAP_NR(tmp)].count = 1;
+      atomic_set(&mem_map[MAP_NR(tmp)].count, 1);
       free_page(tmp);
     }
   tmp = nr_free_pages << PAGE_SHIFT;
@@ -192,9 +192,9 @@
 		if (PageReserved(mem_map+i))
 			continue;
 		val->totalram++;
-		if (!mem_map[i].count)
+		if (!atomic_read(&mem_map[i].count))
 			continue;
-		val->sharedram += mem_map[i].count-1;
+		val->sharedram += atomic_read(&mem_map[i].count) - 1;
 	}
 	val->totalram <<= PAGE_SHIFT;
 	val->sharedram <<= PAGE_SHIFT;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov