From ac27fd45d7a7c718dea64db8ec5e0d9626dda55c Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Mon, 8 Aug 2022 16:32:19 +0000 Subject: [PATCH] Try reserving less RAM to fix windows booting Related: #2115202 Signed-off-by: Robbie Harwood --- 0277-Try-reserving-less-ram.patch | 34 +++++++++++++++++++++++++++++++ grub.patches | 1 + grub2.spec | 6 +++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0277-Try-reserving-less-ram.patch diff --git a/0277-Try-reserving-less-ram.patch b/0277-Try-reserving-less-ram.patch new file mode 100644 index 0000000..46fb871 --- /dev/null +++ b/0277-Try-reserving-less-ram.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Peter Jones +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 +--- + 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)) diff --git a/grub.patches b/grub.patches index 4a39c3a..58ef358 100644 --- a/grub.patches +++ b/grub.patches @@ -274,3 +274,4 @@ Patch0273: 0273-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch Patch0274: 0274-efi-allocate-the-initrd-within-the-bounds-expressed-.patch Patch0275: 0275-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch Patch0276: 0276-BLS-create-etc-kernel-cmdline-during-mkconfig.patch +Patch0277: 0277-Try-reserving-less-ram.patch diff --git a/grub2.spec b/grub2.spec index e8553cf..1d6a5fd 100644 --- a/grub2.spec +++ b/grub2.spec @@ -17,7 +17,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 46%{?dist} +Release: 47%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -530,6 +530,10 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Mon Aug 08 2022 Robbie Harwood - 2.06-47 +- Try reserving less RAM to fix windows booting +- Related: #2115202 + * Tue Aug 02 2022 Robbie Harwood - 2.06-46 - Populate /etc/kernel/cmdline during mkconfig