svn commit: r330891 - head/stand/uboot/common

Kyle Evans kevans at FreeBSD.org
Wed Mar 14 02:35:50 UTC 2018


Author: kevans
Date: Wed Mar 14 02:35:49 2018
New Revision: 330891
URL: https://svnweb.freebsd.org/changeset/base/330891

Log:
  ubldr: Bump heap size from 512K to 1M
  
  lualoader in itself only uses another ~200K, but there seems to be no reason
  not to bump it a little higher to give us some more wiggle room.
  
  With this, I can boot using a menu-enabled lualoader, no problem and
  reasonably fast. Some heap usage datapoints from the review:
  
  forthloader, no menus, kernel loaded:
  heap base at 0x1203d5b0, top at 0x1208e000, used 330320
  
  lualoader, no menus, kernel loaded:
  heap base at 0x42050028, top at 0x420ab000, used 372696
  
  lualoader, menus, kernel loaded:
  heap base at 0x42050028, top at 0x420d5000, used 544728
  
  Since then, the no menu case for lualoader should have decreased slightly as
  I've made some changes to make sure that it no longer loads any of th emenu
  bits with beastie disabled.
  
  While here, split heap size out into a HEAP_SIZE macro.
  
  Reviewed by:	ian, imp
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D14471

Modified:
  head/stand/uboot/common/main.c

Modified: head/stand/uboot/common/main.c
==============================================================================
--- head/stand/uboot/common/main.c	Wed Mar 14 01:38:47 2018	(r330890)
+++ head/stand/uboot/common/main.c	Wed Mar 14 02:35:49 2018	(r330891)
@@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$");
 #define	nitems(x)	(sizeof((x)) / sizeof((x)[0]))
 #endif
 
+#ifndef HEAP_SIZE
+#define	HEAP_SIZE	(1 * 1024 * 1024)
+#endif
+
 struct uboot_devdesc currdev;
 struct arch_switch archsw;		/* MI/MD interface boundary */
 int devs_no;
@@ -421,7 +425,7 @@ main(int argc, char **argv)
 	 * of our bss and the bottom of the u-boot stack to avoid overlap.
 	 */
 	uboot_heap_start = round_page((uintptr_t)end);
-	uboot_heap_end   = uboot_heap_start + 512 * 1024;
+	uboot_heap_end   = uboot_heap_start + HEAP_SIZE;
 	setheap((void *)uboot_heap_start, (void *)uboot_heap_end);
 
 	/*


More information about the svn-src-head mailing list