From: sashiko-bot@kernel.org
To: "Yury Norov" <ynorov@nvidia.com>
Cc: dri-devel@lists.freedesktop.org,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Danilo Krummrich" <dakr@kernel.org>,
ojeda@kernel.org
Subject: Re: [PATCH v2] lib: test bitmap vs IDA vs Maple Tree performance for region allocations
Date: Sat, 11 Jul 2026 06:44:54 +0000 [thread overview]
Message-ID: <20260711064454.A80E61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260711063602.426311-1-ynorov@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The benchmark allocates over 9.1 MB of static arrays in `.init.data`, which bloats the kernel image and can cause boot failures on memory-constrained architectures.
--
--- Patch [1]: [PATCH v2] lib: test bitmap vs IDA vs Maple Tree performance for region allocations ---
commit 3ff59b7f49e8b1a285e39778b952abbfe86e1ed9
Author: Yury Norov <ynorov@nvidia.com>
lib: test bitmap vs IDA vs Maple Tree performance for region allocations
This commit adds a microbenchmark to compare the cost of allocating and
freeing variable-sized regions using a bitmap, IDA, and a Maple Tree. It
processes a randomly generated sequence of region sizes until the configured
capacity is exhausted.
Link: https://lore.kernel.org/all/20260710-chid-maple-v1-1-4ee869055268@nvidia.com/
> diff --git a/lib/region_alloc_benchmark.c b/lib/region_alloc_benchmark.c
> new file mode 100644
> index 0000000000000..46cd0dfe935f6
> --- /dev/null
> +++ b/lib/region_alloc_benchmark.c
> @@ -0,0 +1,174 @@
[ ... ]
> +#define MAP_SIZE (1000000UL)
> +#define REGION_MAX_SIZE 32
> +
> +static DECLARE_BITMAP(alloc_bitmap, MAP_SIZE) __initdata;
> +/* One more request guarantees that even an all-ones trace reaches ENOSPC. */
> +static u8 region_sizes[MAP_SIZE + 1] __initdata;
> +static unsigned long region_indexes[MAP_SIZE] __initdata;
[Severity: Medium]
Is it safe to allocate over 9.1 MB of static arrays in .init.data here?
This inflates the uncompressed kernel image size and can cause build failures
like relocation truncation or boot failures on memory-constrained architectures,
especially when built-in via allmodconfig.
Could these large benchmark buffers be dynamically allocated at runtime using
kvmalloc_array() or vmalloc() instead?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260711063602.426311-1-ynorov@nvidia.com?part=1
next prev parent reply other threads:[~2026-07-11 6:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 6:36 [PATCH v2] lib: test bitmap vs IDA vs Maple Tree performance for region allocations Yury Norov
2026-07-11 6:44 ` sashiko-bot [this message]
2026-07-11 8:27 ` Onur Özkan
2026-07-15 1:49 ` Yury Norov
2026-07-11 13:51 ` Gary Guo
2026-07-15 5:00 ` Yury Norov
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=20260711064454.A80E61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=acourbot@nvidia.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=ynorov@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.