linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "J. Neuschäfer" <j.ne@posteo.net>
To: Simon Glass <sjg@chromium.org>
Cc: linux-arm-kernel@lists.infradead.org,
	"Tom Rini" <trini@konsulko.com>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"J . Neuschäfer" <j.ne@posteo.net>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	"Chen-Yu Tsai" <wenst@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] scripts/make_fit: Speed up operation
Date: Sun, 21 Sep 2025 10:31:21 +0000	[thread overview]
Message-ID: <aM_T9mtmEdAGNpLi@probook> (raw)
In-Reply-To: <20250919224639.1122848-2-sjg@chromium.org>

On Fri, Sep 19, 2025 at 04:46:25PM -0600, Simon Glass wrote:
> The kernel is likely at least 16MB so we may as well use that as a step
> size when reallocating space for the FIT in memory. Pack the FIT at the
> end, so there is no wasted space.
> 
> This reduces the time to pack by an order of magnitude, or so.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> 
> ---
> 
> (no changes since v1)
> 
>  scripts/make_fit.py | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/make_fit.py b/scripts/make_fit.py
> index b4caa127d2c3..904f45088978 100755
> --- a/scripts/make_fit.py
> +++ b/scripts/make_fit.py
> @@ -100,7 +100,7 @@ def setup_fit(fsw, name):
>          fsw (libfdt.FdtSw): Object to use for writing
>          name (str): Name of kernel image
>      """
> -    fsw.INC_SIZE = 65536
> +    fsw.INC_SIZE = 16 << 20
>      fsw.finish_reservemap()
>      fsw.begin_node('')
>      fsw.property_string('description', f'{name} with devicetree set')
> @@ -330,10 +330,12 @@ def build_fit(args):
>  
>          entries.append([model, compat, files_seq])
> 

> -    finish_fit(fsw, entries)
> +    finish_fit(fsw, entries, bool(args.ramdisk))

It seems like this line should rather go into the previous patch.

>  
>      # Include the kernel itself in the returned file count
> -    return fsw.as_fdt().as_bytearray(), seq + 1, size
> +    fdt = fsw.as_fdt()
> +    fdt.pack()
> +    return fdt.as_bytearray(), seq + 1, size

The rest looks good to me. Easy optimization, big win :)


Best regards,
J. Neuschäfer


  reply	other threads:[~2025-09-21 10:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 22:46 [PATCH v2 1/2] scripts/make_fit: Support an initial ramdisk Simon Glass
2025-09-19 22:46 ` [PATCH v2 2/2] scripts/make_fit: Speed up operation Simon Glass
2025-09-21 10:31   ` J. Neuschäfer [this message]
2025-09-22 22:49     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aM_T9mtmEdAGNpLi@probook \
    --to=j.ne@posteo.net \
    --cc=a.fatoum@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).