Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oPnaW-00018D-8K for mharc-grub-devel@gnu.org; Sun, 21 Aug 2022 12:14:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPnaU-00017q-3n for grub-devel@gnu.org; Sun, 21 Aug 2022 12:14:10 -0400 Received: from marcansoft.com ([212.63.210.85]:45638 helo=mail.marcansoft.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPnaR-0008ID-CE for grub-devel@gnu.org; Sun, 21 Aug 2022 12:14:09 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 7540842614; Sun, 21 Aug 2022 16:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1661098442; bh=gYPSTM7aUIvBjSLeBSMsweLzMW9hksNlMmR4Ebeh/RU=; h=Date:To:References:From:Subject:In-Reply-To; b=k+iISQYYNOfqN0mEp/pjXiWzk2lU/jBrf15IDNrPV+lTu8RhQ2zn4KSnl7NbCkZyx LxVM+ZYz6JC8squ7MhuMb4Yv/bgBabqPjJooO/++Gf3ilgnpi4o2TFcZ8fTiUck186 O62PQvcTI9PaDihQoHaB1hQn2VLxtwrTE/8V18RjTSg2aLTYI7SAwOTaQPKCw/9vAP u8gpLuc58tJtwy+j2Cj0OUothd8TpZMBU5u8CnO0wcaN3XScu0H2RwT9vUIf9mycRI Du/gn7KgwXd7ZMy14XrvBvI8F3NtkL85RL4EYI5t9hFOK1HCjd/ua/GMHyqJYX0WfO 7qqC1ol2fmwYA== Message-ID: Date: Mon, 22 Aug 2022 01:13:57 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: es-ES To: Daniel Axtens , grub-devel@gnu.org, Patrick Steinhardt References: <20220820152412.158952-1-marcan@marcan.st> <87mtbxojuk.fsf@dja-thinkpad.axtens.net> From: Hector Martin Subject: Re: [PATCH] kern/efi/mm: Double the default heap size In-Reply-To: <87mtbxojuk.fsf@dja-thinkpad.axtens.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=212.63.210.85; envelope-from=marcan@marcan.st; helo=mail.marcansoft.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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 16:14:10 -0000 On 21/08/2022 21.35, Daniel Axtens wrote: > 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. Interesting. I missed the indirection through the function pointer... but either way, I do indeed have those commits in the broken tree that Arch Linux ARM started shipping yesterday (0c6c1aff2a, which isn't actually current master but it's from a couple weeks ago). The previous version was 2f4430cc0, which doesn't have it, so I wonder if there was actually a regression involved? What I see is that GRUB briefly flashes an out of memory error and fails to set the graphics mode, then ends up in text mode. My best guess without digging further is that it fails to allocate a framebuffer or console text buffer (since these machines have higher resolution screens than most, this might not have come up elsewhere). But I don't see why that would have to happen before it's allowed? > I f my maths are right, this bumps up the initial allocation from 1M to > 2M. Correct. > 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? I think that makes sense. - Hector