[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] linux-2.6.18/kexec: don't initialize when no crash area was reserved



While the waste of memory needed may not be significant, the amount of
additional but pointless entries in /proc/iomem certainly may be (on
large systems).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/drivers/xen/core/machine_kexec.c
+++ b/drivers/xen/core/machine_kexec.c
@@ -34,6 +34,17 @@ void __init xen_machine_kexec_setup_reso
        if (!is_initial_xendomain())
                return;
 
+       /* fill in crashk_res if range is reserved by hypervisor */
+       memset(&range, 0, sizeof(range));
+       range.range = KEXEC_RANGE_MA_CRASH;
+
+       if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range)
+           || !range.size)
+               return;
+
+       crashk_res.start = range.start;
+       crashk_res.end = range.start + range.size - 1;
+
        /* determine maximum number of physical cpus */
        op.cmd = XENPF_get_cpuinfo;
        op.u.pcpu_info.xen_cpuid = 0;
@@ -96,19 +107,6 @@ void __init xen_machine_kexec_setup_reso
        xen_hypervisor_res.end = range.start + range.size - 1;
        xen_hypervisor_res.flags = IORESOURCE_BUSY | IORESOURCE_MEM;
 
-       /* fill in crashk_res if range is reserved by hypervisor */
-
-       memset(&range, 0, sizeof(range));
-       range.range = KEXEC_RANGE_MA_CRASH;
-
-       if (HYPERVISOR_kexec_op(KEXEC_CMD_kexec_get_range, &range))
-               goto free;
-
-       if (range.size) {
-               crashk_res.start = range.start;
-               crashk_res.end = range.start + range.size - 1;
-       }
-
        /* get physical address of vmcoreinfo */
        memset(&range, 0, sizeof(range));
        range.range = KEXEC_RANGE_MA_VMCOREINFO;



Attachment: xen-kexec-no-setup.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.