From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mKlcN-0001U7-Qf for mharc-grub-devel@gnu.org; Mon, 30 Aug 2021 14:02:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKlcM-0001Tu-9h for grub-devel@gnu.org; Mon, 30 Aug 2021 14:02:46 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:49439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKlcK-0003d4-Jr for grub-devel@gnu.org; Mon, 30 Aug 2021 14:02:46 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 4B03632009FE; Mon, 30 Aug 2021 14:02:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 30 Aug 2021 14:02:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=LGA7jmeRr9jLCxakQrWSZSJ1lky EiuNueD1blE4Fs1k=; b=EHAMyWBOsdBmnU8x5IAfj6XI1+zL+CriY2YMxJGqfqd fFLbt45ADQxyO1/DY8CMf25Jj4ht2CvOIxotTv0vzHwKx9I9KE+9oXhNH/l+kzzF 3Dyo+b6mJq3WqIgpWLfApBujRiXSXoWf/9g4PGIud07Ws0jtYpN4yvSu6l13fcKJ SKOpsOgynkY9xcYYZBr09DCu1Aa7OWme0a7f9tMc5c82yqYw3wi8rsO2LzEA6jFI cRfQyv88ikiRdmhwjozaM1aXFArliil4QK33Te6SGdEd8cGhMQCcB6H+4Kp/4Ezh 3Ea6aEvvtBUiaq2sXVirNfUotjsQ4LvMbxNijoWnpNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=LGA7jm eRr9jLCxakQrWSZSJ1lkyEiuNueD1blE4Fs1k=; b=axgkjldP0/PCxYvIRBtgnc G3To88YProhJq2hzkRLoCCoeYGYt2mPzhWvjxYFVU7rIEj4nkFljcMvO2wlcIUau vT6jYbYNW3sIepV5yV46ABc40RTu7AMcPe46oxqTNes4CgJ3bs0GlrFTt1qrmMIX QYG3OvTvL6DvlGH+aHEMLEzMRBiDM8wjX+pb8Lf9OGVkE3PNUBBwJg8Tl6oLFmIv Z966y+BvySuEgfwGC9vFmkhvqwKTvLOKbvnw5yBOMSVQyQMsQmZ+051QxRuIFjOP Cdy251afUAQUeSb2MmFM/IBskkeEyJTeOjvbQbVTI2j/rnpcRpvqTqmC8L6YSQGg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudduledguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnhepheeghfdtfeeuffehkefgffduleffjedthfdvjeektdfhhedvlefgtefgvdettdfh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhsse hpkhhsrdhimh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Aug 2021 14:02:38 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 3a0c630a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 30 Aug 2021 18:02:36 +0000 (UTC) Date: Mon, 30 Aug 2021 20:05:29 +0200 From: Patrick Steinhardt To: The development of GNU GRUB Cc: Daniel Axtens , Leif Lindholm , Stefan Berger Subject: Re: [PATCH v3 0/6] Runtime allocation of memory regions Message-ID: References: <20210826151232.zo2embyicdlpotrz@tomti.i.net-space.pl> <87wno77e06.fsf@dja-thinkpad.axtens.net> <20210830174907.mhvzxxinxeugdhca@tomti.i.net-space.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="B4OKSS4s4tV0YO7n" Content-Disposition: inline In-Reply-To: <20210830174907.mhvzxxinxeugdhca@tomti.i.net-space.pl> Received-SPF: pass client-ip=64.147.123.21; envelope-from=ps@pks.im; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2021 18:02:46 -0000 --B4OKSS4s4tV0YO7n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 30, 2021 at 07:49:07PM +0200, Daniel Kiper wrote: > On Fri, Aug 27, 2021 at 01:39:05PM +1000, Daniel Axtens wrote: > > Daniel Kiper writes: > > > > > Hey, > > > > > > Adding Daniel Axtens... > > > > > > On Sun, Aug 15, 2021 at 01:09:06PM +0200, Patrick Steinhardt wrote: > > >> Hi, > > >> > > >> this is the third version of my patch set to implement runtime > > >> allocation of additional memory regions. > > >> > > >> Changes compared to v2: > > >> > > >> - A new preparatory patch was added to remove unused code which > > >> unloaded modules on OOM. > > >> > > >> - Patch 2/4 has been split up into two patches: one to drop the > > >> logic where we request a quarter of available memory and then > > >> put bounds to it, and one to split apart request of additional > > >> regions and initialization of the EFI MM system. > > >> > > >> - Flags are now `unsigned int` instead of `unsigned`. > > >> > > >> - `add_memory_regions ()` now gets all flags instead of only a > > >> single flag `consecutive`. > > >> > > >> - Flags are now defines and not an enum anymore. > > >> > > >> - The callback function is now called `grub_mm_add_region_func_t` > > >> instead of `grub_mm_region_func_t`. Flags and its variable have > > >> been renamed accordingly. > > >> > > >> Patrick > > >> > > >> Patrick Steinhardt (6): > > >> mm: Drop unused unloading of modules on OOM > > >> mm: Allow dynamically requesting additional memory regions > > >> efi: mm: Always request a fixed number of pages on init > > >> efi: mm: Extract function to add memory regions > > >> efi: mm: Pass up errors from `add_memory_regions ()` > > >> efi: mm: Implement runtime addition of pages > > >> > > >> grub-core/kern/dl.c | 20 ---------- > > >> grub-core/kern/efi/mm.c | 83 +++++++++++++++++++-------------------= --- > > >> grub-core/kern/mm.c | 12 +++--- > > >> include/grub/dl.h | 1 - > > >> include/grub/mm.h | 16 ++++++++ > > >> 5 files changed, 61 insertions(+), 71 deletions(-) > > > > > > Patrick, I went quickly through this patch series and in general it > > > LGTM. There are some minor issues but we can fix them later. Thank > > > you for doing this work. > > > > > > Stefan and/or Daniel Axtens, may I ask you to test these patches with > > > your use case? If it works for you please repost this patch series wi= th > > > your changes added. Then I will merge it after final review. > > > > Sure, I'll have a look. > > > > My initial thoughts are: > > > > - with the CAS support patch. We would still need that, and would want > > to do that call early as possible because it will cause the partition > > to be rebooted. > > > > - We have to be careful where we ask for memory because the kernel > > assumes that there will be some free memory below a particular addre= ss. > > > > - I'd also want to verify what the performance impact would be - not > > just on powerpc-ieee1275 but also on efi - of going out to > > OpenFirmware/UEFI for each new zone... >=20 > Good point! I was thinking about performance at some point too. Sadly > I forgot to say something about that... Patrick, did you compare > performance before and after you patch series? If the impact is > significant maybe we should not change initial allocation strategy > and add a function to allocate more memory during runtime only... >=20 > > I'll test this early next week and report back. >=20 > Cool! Thanks a lot! >=20 > Daniel The question is how to measure performance. Are there any benchmarks that result in somewhat reproducible results? Patrick --B4OKSS4s4tV0YO7n Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAmEtHegACgkQVbJhu7ck PpSJOw//VeE94dGupjT+fgYDrrFtlYERNR4w1cBC2MU1uGOsGcK9qKaBo7Nh0aUa 5dhclf1RHIobfXe/EO93NUVb3EfGODb8Wcl1CVDpW5JPgFEJPyzNYV7O/7u/fi+X MQCfdAK8fVuSlkbU8zo1jeNDLZJ+W2w37PCWxX5uGOe0JeGANJXoICJVRd0a0Z+F QHQHkwdyC//lYgIVWyFbb6rDg+w7M4X80DhlxkOCBcUrtYsHWgluLntqxl/M/i5J taUW8SFLVyDg9l2Y07ASEq68ry9gwE1806UDLktliwVkdb9zFuMRcDT+oS9obA57 8jKOGyugB8h0O9pwd5RQueC2v75b1E5QIEAyzcU3zO837xE7kEM93srRpfcn8T08 +ieY9ME/NMWNzBaPtzGMd0TJrK8eu9ivExqCPmdoiAeBKq4khkAcinHyimykTJxl K/u+lz2CLBZGCamZad0f41LeonUY4T55g/iNf89mdlfwIDSy8YMdDyAGllbImd7Z onH5juZGJNsRpqA79wn8i6H2jBD4KVG49GcjzmypLVaxHlI3vafNF9xIfHO2VxTO yG2iqG8HCNK4gEY0juntHnRLQgwq7U5xODAq1D+5kbe/d8Bhjs0ikhNwXTIHNW4I FHVoXnsg9gJL1qYVutUhGtWZka1rQ2F0EsOvofgkvZzCtEe43dY= =9Zyt -----END PGP SIGNATURE----- --B4OKSS4s4tV0YO7n--