kexec, vmalloc: export additional vmalloc layer information
authorAtsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Mon, 29 Apr 2013 22:07:40 +0000 (15:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 29 Apr 2013 22:54:34 +0000 (15:54 -0700)
Now, vmap_area_list is exported as VMCOREINFO for makedumpfile to get
the start address of vmalloc region (vmalloc_start).  The address which
contains vmalloc_start value is represented as below:

  vmap_area_list.next - OFFSET(vmap_area.list) + OFFSET(vmap_area.va_start)

However, both OFFSET(vmap_area.va_start) and OFFSET(vmap_area.list)
aren't exported as VMCOREINFO.

So this patch exports them externally with small cleanup.

[akpm@linux-foundation.org: vmalloc.h should include list.h for list_head]
Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Dave Anderson <anderson@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/vmalloc.h
kernel/kexec.c
mm/vmalloc.c

index 8a25f9081ed031b99d8c3d33b2eca28efe4f23fe..7d5773a99f20690dac2bbf60dbcda274b9c20ae8 100644 (file)
@@ -3,7 +3,9 @@
 
 #include <linux/spinlock.h>
 #include <linux/init.h>
+#include <linux/list.h>
 #include <asm/page.h>          /* pgprot_t */
+#include <linux/rbtree.h>
 
 struct vm_area_struct;         /* vma defining user mapping in mm_types.h */
 
@@ -35,6 +37,17 @@ struct vm_struct {
        const void              *caller;
 };
 
+struct vmap_area {
+       unsigned long va_start;
+       unsigned long va_end;
+       unsigned long flags;
+       struct rb_node rb_node;         /* address sorted rbtree */
+       struct list_head list;          /* address sorted list */
+       struct list_head purge_list;    /* "lazy purge" list */
+       struct vm_struct *vm;
+       struct rcu_head rcu_head;
+};
+
 /*
  *     Highlevel APIs for driver use
  */
index 0b1f7e780d46a276130ad0d69891fbcd920a907c..b574920cbd4b3fe70286647c8da199c7df310d07 100644 (file)
@@ -1615,7 +1615,8 @@ static int __init crash_save_vmcoreinfo_init(void)
        VMCOREINFO_OFFSET(free_area, free_list);
        VMCOREINFO_OFFSET(list_head, next);
        VMCOREINFO_OFFSET(list_head, prev);
-       VMCOREINFO_OFFSET(vm_struct, addr);
+       VMCOREINFO_OFFSET(vmap_area, va_start);
+       VMCOREINFO_OFFSET(vmap_area, list);
        VMCOREINFO_LENGTH(zone.free_area, MAX_ORDER);
        log_buf_kexec_setup();
        VMCOREINFO_LENGTH(free_area.free_list, MIGRATE_TYPES);
index 151da8ac53fa474949818dd0c17ba39911938179..72043d6c88c09c16b581c571cb6b79ee12a34b68 100644 (file)
@@ -249,17 +249,6 @@ EXPORT_SYMBOL(vmalloc_to_pfn);
 #define VM_LAZY_FREEING        0x02
 #define VM_VM_AREA     0x04
 
-struct vmap_area {
-       unsigned long va_start;
-       unsigned long va_end;
-       unsigned long flags;
-       struct rb_node rb_node;         /* address sorted rbtree */
-       struct list_head list;          /* address sorted list */
-       struct list_head purge_list;    /* "lazy purge" list */
-       struct vm_struct *vm;
-       struct rcu_head rcu_head;
-};
-
 static DEFINE_SPINLOCK(vmap_area_lock);
 /* Export for kexec only */
 LIST_HEAD(vmap_area_list);