X25: Move interrupt flag to bitfield
[linux-2.6.git] / mm / mm_init.c
index e16990d..4e0e265 100644 (file)
@@ -7,9 +7,61 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/kobject.h>
+#include <linux/module.h>
 #include "internal.h"
 
-int __meminitdata mminit_loglevel;
+#ifdef CONFIG_DEBUG_MEMORY_INIT
+int mminit_loglevel;
+
+#ifndef SECTIONS_SHIFT
+#define SECTIONS_SHIFT 0
+#endif
+
+/* The zonelists are simply reported, validation is manual. */
+void mminit_verify_zonelist(void)
+{
+       int nid;
+
+       if (mminit_loglevel < MMINIT_VERIFY)
+               return;
+
+       for_each_online_node(nid) {
+               pg_data_t *pgdat = NODE_DATA(nid);
+               struct zone *zone;
+               struct zoneref *z;
+               struct zonelist *zonelist;
+               int i, listid, zoneid;
+
+               BUG_ON(MAX_ZONELISTS > 2);
+               for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) {
+
+                       /* Identify the zone and nodelist */
+                       zoneid = i % MAX_NR_ZONES;
+                       listid = i / MAX_NR_ZONES;
+                       zonelist = &pgdat->node_zonelists[listid];
+                       zone = &pgdat->node_zones[zoneid];
+                       if (!populated_zone(zone))
+                               continue;
+
+                       /* Print information about the zonelist */
+                       printk(KERN_DEBUG "mminit::zonelist %s %d:%s = ",
+                               listid > 0 ? "thisnode" : "general", nid,
+                               zone->name);
+
+                       /* Iterate the zonelist */
+                       for_each_zone_zonelist(zone, z, zonelist, zoneid) {
+#ifdef CONFIG_NUMA
+                               printk(KERN_CONT "%d:%s ",
+                                       zone->node, zone->name);
+#else
+                               printk(KERN_CONT "0:%s ", zone->name);
+#endif /* CONFIG_NUMA */
+                       }
+                       printk(KERN_CONT "\n");
+               }
+       }
+}
 
 void __init mminit_verify_pageflags_layout(void)
 {
@@ -26,11 +78,7 @@ void __init mminit_verify_pageflags_layout(void)
                NR_PAGEFLAGS);
        mminit_dprintk(MMINIT_TRACE, "pageflags_layout_shifts",
                "Section %d Node %d Zone %d\n",
-#ifdef SECTIONS_SHIFT
                SECTIONS_SHIFT,
-#else
-               0,
-#endif
                NODES_SHIFT,
                ZONES_SHIFT);
        mminit_dprintk(MMINIT_TRACE, "pageflags_layout_offsets",
@@ -87,3 +135,18 @@ static __init int set_mminit_loglevel(char *str)
        return 0;
 }
 early_param("mminit_loglevel", set_mminit_loglevel);
+#endif /* CONFIG_DEBUG_MEMORY_INIT */
+
+struct kobject *mm_kobj;
+EXPORT_SYMBOL_GPL(mm_kobj);
+
+static int __init mm_sysfs_init(void)
+{
+       mm_kobj = kobject_create_and_add("mm", kernel_kobj);
+       if (!mm_kobj)
+               return -ENOMEM;
+
+       return 0;
+}
+
+__initcall(mm_sysfs_init);