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

[Xen-changelog] [xen-unstable] hvmloader: reduce minimum allocation alignment from 1024 bytes to 16.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1307118088 -3600
# Node ID 41040769aa8f3d6728354e6449ba45fcaf27bbdb
# Parent  921dcd80f79120bd9938b4ee0fec7428b2da0f6e
hvmloader: reduce minimum allocation alignment from 1024 bytes to 16.

1024 bytes create a lot of wastage when the majority of allocations
are of BIOS table data structures which are generally happy with much
lower alignment. I conservatively chose 16 bytes.

Most callers pass 0 for the alignment anyway, for the rombios high
code allocation I kept it 1024 byte aligned since it was the only case
that didn't seem obviously ok with a smaller alignment.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 921dcd80f791 -r 41040769aa8f 
tools/firmware/hvmloader/32bitbios_support.c
--- a/tools/firmware/hvmloader/32bitbios_support.c      Fri Jun 03 15:04:30 
2011 +0100
+++ b/tools/firmware/hvmloader/32bitbios_support.c      Fri Jun 03 17:21:28 
2011 +0100
@@ -67,7 +67,7 @@
      */
     reloc_size = reloc_off;
     printf("%d bytes of ROMBIOS high-memory extensions:\n", reloc_size);
-    highbiosarea = mem_alloc(reloc_size, 0);
+    highbiosarea = mem_alloc(reloc_size, 1024);
     BUG_ON(highbiosarea == NULL);
     printf("  Relocating to 0x%x-0x%x ... ",
            (uint32_t)&highbiosarea[0],
diff -r 921dcd80f791 -r 41040769aa8f tools/firmware/hvmloader/util.c
--- a/tools/firmware/hvmloader/util.c   Fri Jun 03 15:04:30 2011 +0100
+++ b/tools/firmware/hvmloader/util.c   Fri Jun 03 17:21:28 2011 +0100
@@ -312,9 +312,9 @@
     xen_pfn_t mfn;
     uint32_t s, e;
 
-    /* Align to at least one kilobyte. */
-    if ( align < 1024 )
-        align = 1024;
+    /* Align to at least 16 bytes. */
+    if ( align < 16 )
+        align = 16;
 
     s = (reserve + align) & ~(align - 1);
     e = s + size - 1;
@@ -366,9 +366,9 @@
 {
     uint32_t s, e;
 
-    /* Align to at least one kilobyte. */
-    if ( align < 1024 )
-        align = 1024;
+    /* Align to at least 16 bytes. */
+    if ( align < 16 )
+        align = 16;
 
     s = (scratch_start + align - 1) & ~(align - 1);
     e = s + size - 1;

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


 


Rackspace

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