efi: Increase default memory allocation to 32MB
PATCH 1/1 efi: Increase default memory allocation to 32MB
We have multiple reports of things being slower with a 1MB initial static allocation, and a report (more difficult to nail down) of a boot failure as a result of the smaller initial allocation.
Make the initial memory allocation 32MB.
--- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/kern/efi/mm.c +1 -1
@@ -39,7 +39,7 @@#define MEMORY_MAP_SIZE 0x3000/* The default heap size for GRUB itself in bytes. */ -#define DEFAULT_HEAP_SIZE 0x100000 +#define DEFAULT_HEAP_SIZE 0x2000000static void *finish_mmap_buf =0 ;static grub_efi_uintn_t finish_mmap_size =0 ;
Signature · 1 line
2.25.1
Adding some folks who may be interested in this thing too...
Quoted 7 lines · Daniel Axtens
We have multiple reports of things being slower with a 1MB initial static allocation, and a report (more difficult to nail down) of a boot failure as a result of the smaller initial allocation.
Make the initial memory allocation 32MB.
Signed-off-by Daniel Axtens <[email protected]>
However, I think we should consider [1] patch set too. I will be looking at it in the following days.
Daniel
[1] https://lists.gnu.org/archive/html/grub-devel/2022-09/msg00080.html
Quoted 17 lines
--- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)grub-core/kern/efi/mm.c +1
-1@@ -39,7 +39,7 @@#define MEMORY_MAP_SIZE 0x3000/* The default heap size for GRUB itself in bytes. */ -#define DEFAULT_HEAP_SIZE 0x100000 +#define DEFAULT_HEAP_SIZE 0x2000000static void *finish_mmap_buf =0 ;static grub_efi_uintn_t finish_mmap_size =0 ;
Quoted 11 lines · Daniel Kiper
Adding some folks who may be interested in this thing too...
Quoted 7 lines · Daniel Axtens
We have multiple reports of things being slower with a 1MB initial static allocation, and a report (more difficult to nail down) of a boot failure as a result of the smaller initial allocation.
Make the initial memory allocation 32MB.
Signed-off-by Daniel Axtens <[email protected]>
Quoted 8 lines
Reviewed-by Daniel Kiper <[email protected]>However, I think we should consider [1] patch set too. I will be looking at it in the following days.
Daniel
[1] https://lists.gnu.org/archive/html/grub-devel/2022-09/msg00080.html
Agreed, we should definitely merge some form of fixes to improve the page request patterns. I'm also happy with bumping the default heap size in addition.
Out of curiosity: do we have any kind of minimum system requirements documented somewhere that would allow us to come up with a default heap size?
Patrick
Quoted 18 lines
Quoted 18 lines
--- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)grub-core/kern/efi/mm.c +1
-1@@ -39,7 +39,7 @@#define MEMORY_MAP_SIZE 0x3000/* The default heap size for GRUB itself in bytes. */ -#define DEFAULT_HEAP_SIZE 0x100000 +#define DEFAULT_HEAP_SIZE 0x2000000static void *finish_mmap_buf =0 ;static grub_efi_uintn_t finish_mmap_size =0 ;
Quoted 17 lines · Patrick Steinhardt
Quoted 16 lines · Daniel Kiper
Adding some folks who may be interested in this thing too...
Quoted 7 lines · Daniel Axtens
We have multiple reports of things being slower with a 1MB initial static allocation, and a report (more difficult to nail down) of a boot failure as a result of the smaller initial allocation.
Make the initial memory allocation 32MB.
Signed-off-by Daniel Axtens <[email protected]>Reviewed-by Daniel Kiper <[email protected]>However, I think we should consider [1] patch set too. I will be looking at it in the following days.
Quoted 7 lines
Quoted 3 lines
Daniel
[1] https://lists.gnu.org/archive/html/grub-devel/2022-09/msg00080.html
Agreed, we should definitely merge some form of fixes to improve the page request patterns. I'm also happy with bumping the default heap size in addition.
Agreed also.
Quoted 5 lines
Out of curiosity: do we have any kind of minimum system requirements documented somewhere that would allow us to come up with a default heap size?
Heh. That'd be nice, and I think valuable, but my experience trying to drop HFS suggests that it might be very controversial.
Kind regards,
Daniel
Quoted 20 lines
Patrick
Quoted 18 lines
Quoted 18 lines
--- grub-core/kern/efi/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)grub-core/kern/efi/mm.c +1
-1@@ -39,7 +39,7 @@#define MEMORY_MAP_SIZE 0x3000/* The default heap size for GRUB itself in bytes. */ -#define DEFAULT_HEAP_SIZE 0x100000 +#define DEFAULT_HEAP_SIZE 0x2000000static void *finish_mmap_buf =0 ;static grub_efi_uintn_t finish_mmap_size =0 ;