Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oPkB4-0002Ce-8D for mharc-grub-devel@gnu.org; Sun, 21 Aug 2022 08:35:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPkB0-00027X-Ht for grub-devel@gnu.org; Sun, 21 Aug 2022 08:35:38 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:42663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPkAm-0001LZ-0Y for grub-devel@gnu.org; Sun, 21 Aug 2022 08:35:37 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 73so7180081pgb.9 for ; Sun, 21 Aug 2022 05:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=FAppfCEqOq2N4+/HTU29A1hoU+c1xQ80QBNIbVqawA0=; b=fAfpAn5md34RJUjLvt5FmxeJhxU7kUbjCBQzNs9XYVPTRn3cw7QR4SxuI/LDhs31jA LHrUH176oy4+Q+SOJclNsneGQKOpNloNORdhg8HgyOd4PRUdcKJI/PtLKfhjxDj0rBhW TAIYfz7UJJ8FDxBWjOtg7d9y40mb3u+P9w5nQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=FAppfCEqOq2N4+/HTU29A1hoU+c1xQ80QBNIbVqawA0=; b=mWetsOslKG7bKfAhdPXSfIa3rp+/xXbMOnt2EnS0iz4fnzJN29L7kb7sBrsVBVnago LvU+B8z9mX0yrb8+0HawpLWduyy++Z4xq5zYw2FPuelRv51WdPXAe+uikFkRxSUDqKdn 5j4wyX/7PW69eQD1yf2VtkKSLpCfxcZYpD97mNRlsMXol7AqxwLbG3yHQwczBVAVwWsr gVhit0xhZ2Rk6L6q2jw81f+8GJ8BxthukkkO+CuLEGs/N06oja3JFFOCidKknVmaR6fA jsrLWu8zNbZbowcVyGSjo8lLSRGz2eNaSf5XpZJltfVerqv2Nbb2zXVpKZJYUrKEMNVI 6KaQ== X-Gm-Message-State: ACgBeo2PKyz3sBpO/H/6ZJGGNpreroNPWS9ybKiNHFx6FQcrgoXX8jas +P1hxY3o3NNxhe/KxEQHjJPAkPdww5bv2A== X-Google-Smtp-Source: AA6agR7SvHaCqmr9xqBem3lDEhFEt0y2HSZS4voOFTiLXftHpJTPhw+wJECeXcFrjM+mpnP9tuYt8A== X-Received: by 2002:aa7:93a8:0:b0:536:8b59:c3bc with SMTP id x8-20020aa793a8000000b005368b59c3bcmr1812740pff.15.1661085320508; Sun, 21 Aug 2022 05:35:20 -0700 (PDT) Received: from localhost ([2001:4479:e300:5b00:dab:c9a7:28f3:a267]) by smtp.gmail.com with ESMTPSA id w1-20020a1709027b8100b0016c16648213sm6223452pll.20.2022.08.21.05.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 05:35:19 -0700 (PDT) From: Daniel Axtens To: grub-devel@gnu.org, Patrick Steinhardt Cc: Hector Martin Subject: Re: [PATCH] kern/efi/mm: Double the default heap size In-Reply-To: <20220820152412.158952-1-marcan@marcan.st> References: <20220820152412.158952-1-marcan@marcan.st> Date: Sun, 21 Aug 2022 22:35:15 +1000 Message-ID: <87mtbxojuk.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=dja@axtens.net; helo=mail-pg1-x52a.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2022 12:35:40 -0000 Hi Hector, Thanks for your patch and for taking the trouble to put it together. > GRUB is already running out of memory on Apple M1 systems, causing > graphics init to fail, as of the latest Git changes. Since dynamic > growing of the heap isn't done yet, double the default heap size for > now. Huh, weird - those changes have landed in git, see commit 887f98f0db43 ("mm: Allow dynamically requesting additional memory regions") for the overarching support and commit 1df2934822df ("kern/efi/mm: Implement runtime addition of pages"). It's not done on PowerPC, but if you're in EFI-land then it should complete. The only reason I can think of off the top of my head where you would be having issues that your patch fixes is if we somehow need more memory to even get to the point where we can ask firmware for more memory. I suppose that's within the realm of possibility. I f my maths are right, this bumps up the initial allocation from 1M to 2M. I think your experience tends to disprove the hypothesis that we could get away with a very small initial allocation (which was the thinking when the initial dynamic allocation patch set went in), so I'm wondering if we should take this opportunity to allocate 16M or 32M or something. My powerpc proposal kept the initial allocation at 32MB, I think that's probably sane for EFI too? Patrick, EFI is much more your area than it is mine, what do you think? Kind regards, Daniel > > Signed-off-by: Hector Martin > --- > 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 d290c9a76270..377d8d3a1c1b 100644 > --- a/grub-core/kern/efi/mm.c > +++ b/grub-core/kern/efi/mm.c > @@ -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 0x200000 > > static void *finish_mmap_buf = 0; > static grub_efi_uintn_t finish_mmap_size = 0; > -- > 2.35.1 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel