From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mJSi2-0003K7-2c for mharc-grub-devel@gnu.org; Thu, 26 Aug 2021 23:39:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJSi1-0003Jb-0Q for grub-devel@gnu.org; Thu, 26 Aug 2021 23:39:13 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:43701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJShz-00074Q-6o for grub-devel@gnu.org; Thu, 26 Aug 2021 23:39:12 -0400 Received: by mail-pj1-x1031.google.com with SMTP id d3-20020a17090ae28300b0019629c96f25so988778pjz.2 for ; Thu, 26 Aug 2021 20:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Rxjv7++TscdWz4dL2SWmyuWMaZmS1A35d1CVWj1sSCc=; b=SBQSz2NVb3JhY012CZXr1LCPUnPpoxJsJGSMiDcE0JVV6kSwoyIjhyyPFjVQlMBoOE uPzkJh2D3E/CK8t0KcieP3zEq1l7moy6uP40BJzbFkt17g9FvRmm7ghF8zbuDlzCJ7OH y/85BbANUwmhinIVyfAIvf7q5HLm5n0rHXqG0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Rxjv7++TscdWz4dL2SWmyuWMaZmS1A35d1CVWj1sSCc=; b=AsedTGMq8NEWjc/bq3eLyhWToziweq2YTN1wuNzsdiNiw0kgNkGJn7sLAcLFac5zme Qyfi00RRnjeKpMm7aKCSnoTD4FofnBaXQ9sAPsxNPDPHDLVi+MEp7LAD6jddqNflDj/u BmLWLc0riyZrzfNkLQauS3plExecjuhMlgqeCQvzCpeSGIi9Av+fK51IHamFF4vJF4hy LNN3kt0snkRmRalhqAKi/qMwzdczyQgQkpVSvSXE/6ThMyKirrSocMvm+O2YRayb/IoK hTPaJYZgNusg9LQs2FO8Oj/PbJLFcP+g5AoPaWMYYwgBomnXkXyUYDnnttw7FKgGVBmf qVuA== X-Gm-Message-State: AOAM532/R5NQk9tYueI+mhBQ6vfOryOnaL3hKnVtxlL0kk7LgH6+Ybkg PNNKx8Wa1FiNqT0CKKXF164tkQ== X-Google-Smtp-Source: ABdhPJxpC2dpWvHARCbpEKRJZSqJ2eDeSRBZVOLRclAiFDZMsZq/ZUjO8ny3/G0ahGuXTjQDr0PCJQ== X-Received: by 2002:a17:90b:3284:: with SMTP id ks4mr18563095pjb.210.1630035549090; Thu, 26 Aug 2021 20:39:09 -0700 (PDT) Received: from localhost ([2001:4479:e200:df00:9bf7:a882:8095:b812]) by smtp.gmail.com with ESMTPSA id 141sm4629746pfv.15.2021.08.26.20.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 20:39:08 -0700 (PDT) From: Daniel Axtens To: Daniel Kiper , Patrick Steinhardt Cc: grub-devel@gnu.org, Leif Lindholm , Stefan Berger Subject: Re: [PATCH v3 0/6] Runtime allocation of memory regions In-Reply-To: <20210826151232.zo2embyicdlpotrz@tomti.i.net-space.pl> References: <20210826151232.zo2embyicdlpotrz@tomti.i.net-space.pl> Date: Fri, 27 Aug 2021 13:39:05 +1000 Message-ID: <87wno77e06.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=dja@axtens.net; helo=mail-pj1-x1031.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: Fri, 27 Aug 2021 03:39:13 -0000 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 with > 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 address. - 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... I'll test this early next week and report back. Kind regards, Daniel > > Daniel