]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off of moving the
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 18 Nov 2013 16:41:37 +0000 (17:41 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 18 Nov 2013 16:41:37 +0000 (17:41 +0100)
pointer to 32K. This is the size of cache element which is the most
common allocation >1K. This way the pointer is always around blocks
of 32K and so we keep performance while decreasing fragmentation.

ChangeLog
grub-core/kern/mm.c

index ba6af6af65bd17dd24d97b39aec9a612e887fe7f..6b66c8e5120bc5afb9f838d696121f9df91b7f14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-18  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off of moving the
+       pointer to 32K. This is the size of cache element which is the most
+       common allocation >1K. This way the pointer is always around blocks
+       of 32K and so we keep performance while decreasing fragmentation.
+
 2013-11-18  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/mm.c (grub_real_malloc): Don't update the pointer to
index 53f3475f5a0049f326b280a23c7ee7a7c68ac857..1c3d02388f09d08787bd596b626c15cabad623ff 100644 (file)
@@ -299,7 +299,7 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align)
             This will have side effect of fragmenting memory as small
             pieces before this will be un-used.  */
          /* So do it only for chunks under 64K.  */
-         if (n < (0x10000 >> GRUB_MM_ALIGN_LOG2)
+         if (n < (0x8000 >> GRUB_MM_ALIGN_LOG2)
              || *first == p)
            *first = q;