Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pRixC-0004QX-Pe for mharc-grub-devel@gnu.org; Mon, 13 Feb 2023 19:13:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRixA-0004QN-NA for grub-devel@gnu.org; Mon, 13 Feb 2023 19:13:48 -0500 Received: from gate.crashing.org ([63.228.1.57]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRix8-0001Lm-Cs for grub-devel@gnu.org; Mon, 13 Feb 2023 19:13:48 -0500 Received: from [IPv6:::1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 31E0ChWe026936; Mon, 13 Feb 2023 18:12:44 -0600 Message-ID: <76570a9cbe0bac8a3b93c406ceadc1713c3df01d.camel@kernel.crashing.org> Subject: Re: Incorrect comment in disk.h (and bigger cache) ? From: Benjamin Herrenschmidt To: The development of GNU GRUB , Mihai Moldovan Date: Tue, 14 Feb 2023 11:12:43 +1100 In-Reply-To: <20230209141351.z7jvxqb5uv44usdk@tomti.i.net-space.pl> References: <37de5ef449072815c134b7bbb6349d6e225eb058.camel@kernel.crashing.org> <52405c34-46b7-40fb-6725-9270109cadac@ionic.de> <20230209141351.z7jvxqb5uv44usdk@tomti.i.net-space.pl> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 Received-SPF: pass client-ip=63.228.1.57; envelope-from=benh@kernel.crashing.org; helo=gate.crashing.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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: Tue, 14 Feb 2023 00:13:49 -0000 On Thu, 2023-02-09 at 15:13 +0100, Daniel Kiper wrote: > > Is that really necessary? Note that this is also used for legacy MBR/BI= OS > > systems and I faintly remember places using that, which may do so in a = fixed > > way, so I advise to check it well if you really intend to change it. >=20 > I concur. I think I would do this only for UEFI systems first. If at all > we need to increase this value. How often the GRUB reads the same files > from the disk? Did you notice faster loads/boots when you increase the > disk cache size? It depends :-) But yes, we have empirical evidence. This is indeed mostly an issue on UEFI systems where we tend to load a few large files since all the modules are contained within the pre-built grub image. Anyways, i'll play around and see if I can come up with something that work= s. Just increasing the size of cache entries actually has a negative impact in things like filesystem metadata for example. And caching large files doesn't make much sense. So I wonder if we can pass some hints or open-time flags to indicate that some files (kernel, initrd) shouldn't bother with caching, along with making get_block() be able to return a number of contiguous blocks, allowin= g large file reads to avoid any bouncing, caching, and enable larger chunks. At this point, it's something I'm putting on my backburner todo list, I mig= ht get to it in the future... Cheers, Ben.