grub2/0277-Try-reserving-less-ram.patch
Robbie Harwood ac27fd45d7 Try reserving less RAM to fix windows booting
Related: #2115202
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-08-08 16:32:19 +00:00

34 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 8 Aug 2022 11:23:59 -0400
Subject: [PATCH] Try reserving less ram...
In 005a0aaaad2a00a1fa1e60d94cc4fd5407c22e7d, we switched from reserving
one quarter of the available free memory to three quarters. Apparently
this has some unfortunate side-affects for some workloads, and has
negatively effected chainloading[0] as well as Fedora CoreOS[1].
This patch changes it to reserve /half/ of available memory, in hopes
that this is a working compromise.
[0] https://bugzilla.redhat.com/show_bug.cgi?id=2115202
[1] https://github.com/coreos/fedora-coreos-tracker/issues/1271
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/kern/efi/mm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 150e412ee7..b4e012f5e7 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -740,7 +740,7 @@ grub_efi_mm_init (void)
/* By default, request three quarters of the available memory. */
total_pages = get_total_pages (filtered_memory_map, desc_size,
filtered_memory_map_end);
- required_pages = (total_pages >> 1) + (total_pages >> 2);
+ required_pages = (total_pages >> 1);
if (required_pages < BYTES_TO_PAGES (MIN_HEAP_SIZE))
required_pages = BYTES_TO_PAGES (MIN_HEAP_SIZE);
else if (required_pages > BYTES_TO_PAGES (MAX_HEAP_SIZE))