kexec: get rid of duplicate check for hole_end
[deliverable/linux.git] / kernel / kexec.c
index 5e4bd7864c5dedf836a7c85cc1ed8e3c4e31e6cb..ea097ad7cc373832b805a5780a3e1114458f5131 100644 (file)
@@ -54,6 +54,12 @@ struct resource crashk_res = {
        .end   = 0,
        .flags = IORESOURCE_BUSY | IORESOURCE_MEM
 };
+struct resource crashk_low_res = {
+       .name  = "Crash kernel low",
+       .start = 0,
+       .end   = 0,
+       .flags = IORESOURCE_BUSY | IORESOURCE_MEM
+};
 
 int kexec_should_crash(struct task_struct *p)
 {
@@ -497,8 +503,6 @@ static struct page *kimage_alloc_crash_control_pages(struct kimage *image,
 
                if (hole_end > KEXEC_CRASH_CONTROL_MEMORY_LIMIT)
                        break;
-               if (hole_end > crashk_res.end)
-                       break;
                /* See if I overlap any of the segments */
                for (i = 0; i < image->nr_segments; i++) {
                        unsigned long mstart, mend;
@@ -1369,10 +1373,11 @@ static int __init parse_crashkernel_simple(char                 *cmdline,
  * That function is the entry point for command line parsing and should be
  * called from the arch-specific code.
  */
-int __init parse_crashkernel(char               *cmdline,
+static int __init __parse_crashkernel(char *cmdline,
                             unsigned long long system_ram,
                             unsigned long long *crash_size,
-                            unsigned long long *crash_base)
+                            unsigned long long *crash_base,
+                               const char *name)
 {
        char    *p = cmdline, *ck_cmdline = NULL;
        char    *first_colon, *first_space;
@@ -1382,16 +1387,16 @@ int __init parse_crashkernel(char                *cmdline,
        *crash_base = 0;
 
        /* find crashkernel and use the last one if there are more */
-       p = strstr(p, "crashkernel=");
+       p = strstr(p, name);
        while (p) {
                ck_cmdline = p;
-               p = strstr(p+1, "crashkernel=");
+               p = strstr(p+1, name);
        }
 
        if (!ck_cmdline)
                return -EINVAL;
 
-       ck_cmdline += 12; /* strlen("crashkernel=") */
+       ck_cmdline += strlen(name);
 
        /*
         * if the commandline contains a ':', then that's the extended
@@ -1409,6 +1414,23 @@ int __init parse_crashkernel(char                 *cmdline,
        return 0;
 }
 
+int __init parse_crashkernel(char *cmdline,
+                            unsigned long long system_ram,
+                            unsigned long long *crash_size,
+                            unsigned long long *crash_base)
+{
+       return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
+                                       "crashkernel=");
+}
+
+int __init parse_crashkernel_low(char *cmdline,
+                            unsigned long long system_ram,
+                            unsigned long long *crash_size,
+                            unsigned long long *crash_base)
+{
+       return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
+                                       "crashkernel_low=");
+}
 
 static void update_vmcoreinfo_note(void)
 {
@@ -1490,6 +1512,8 @@ static int __init crash_save_vmcoreinfo_init(void)
        VMCOREINFO_OFFSET(page, _count);
        VMCOREINFO_OFFSET(page, mapping);
        VMCOREINFO_OFFSET(page, lru);
+       VMCOREINFO_OFFSET(page, _mapcount);
+       VMCOREINFO_OFFSET(page, private);
        VMCOREINFO_OFFSET(pglist_data, node_zones);
        VMCOREINFO_OFFSET(pglist_data, nr_zones);
 #ifdef CONFIG_FLAT_NODE_MEM_MAP
@@ -1512,6 +1536,8 @@ static int __init crash_save_vmcoreinfo_init(void)
        VMCOREINFO_NUMBER(PG_lru);
        VMCOREINFO_NUMBER(PG_private);
        VMCOREINFO_NUMBER(PG_swapcache);
+       VMCOREINFO_NUMBER(PG_slab);
+       VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
 
        arch_crash_save_vmcoreinfo();
        update_vmcoreinfo_note();
This page took 0.03015 seconds and 5 git commands to generate.