From: sashiko-bot@kernel.org
To: "Arunpravin Paneer Selvam" <Arunpravin.PaneerSelvam@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 2/2] gpu/tests/buddy: add dirty tracker performance KUnit test
Date: Tue, 07 Jul 2026 14:24:27 +0000 [thread overview]
Message-ID: <20260707142428.D415F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260707141238.711499-2-Arunpravin.PaneerSelvam@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Resource exhaustion (OOM) due to massive allocation loop in KUnit test
--
--- Patch [2]: [PATCH v5 2/2] gpu/tests/buddy: add dirty tracker performance KUnit test ---
commit 227b33731ff64ce8294c937aa003f6e17a7481ed
Author: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
gpu/tests/buddy: add dirty tracker performance KUnit test
This commit adds a new KUnit test to demonstrate the performance advantage of the decoupled dirty-tracker design. The test runs two scenarios on a 4 GiB pool with 4 KiB allocations to evaluate contiguous and repeated allocation latency.
> diff --git a/drivers/gpu/tests/gpu_buddy_test.c b/drivers/gpu/tests/gpu_buddy_test.c
> index e31f368ada951..e37505849ecc7 100644
> --- a/drivers/gpu/tests/gpu_buddy_test.c
> +++ b/drivers/gpu/tests/gpu_buddy_test.c
[ ... ]
> +static void gpu_test_buddy_dirty_tracker_performance(struct kunit *test)
> +{
[ ... ]
> + KUNIT_ASSERT_FALSE_MSG(test, gpu_buddy_init(&mm, SZ_4G, SZ_4K),
> + "buddy_init failed\n");
> +
> + for (i = 0; i < SZ_4G / SZ_4K; i++)
> + KUNIT_ASSERT_FALSE_MSG(test,
> + gpu_buddy_alloc_blocks(&mm, 0, SZ_4G, SZ_4K, SZ_4K,
> + &allocated, 0),
> + "buddy_alloc hit an error size=%u\n", SZ_4K);
[Severity: Medium]
Could this loop cause an Out-Of-Memory (OOM) regression in constrained KUnit
environments?
Since the test fragments a 4 GiB pool into 4 KiB chunks, this loop executes
1,048,576 times. The allocator will create nearly 2 million struct
gpu_buddy_block metadata nodes, which can consume around 192 MB of kernel slab
memory (and significantly more with KASAN enabled).
KUnit tests often run in restricted environments like UML with 128-256 MB of
RAM, so this might reliably trigger an OOM panic and break the test suite.
Could a smaller pool size be used to demonstrate the performance difference
without consuming as much kernel memory?
[ ... ]
> + /*
> + * Repeated alloc throughput from a maximally fragmented pool
[ ... ]
> + KUNIT_ASSERT_FALSE_MSG(test, gpu_buddy_init(&mm, SZ_4G, SZ_4K),
> + "buddy_init failed\n");
> +
> + for (i = 0; i < SZ_4G / SZ_4K; i++)
> + KUNIT_ASSERT_FALSE_MSG(test,
> + gpu_buddy_alloc_blocks(&mm, 0, SZ_4G, SZ_4K, SZ_4K,
> + &allocated, 0),
> + "buddy_alloc hit an error size=%u\n", SZ_4K);
[Severity: Medium]
The same massive allocation loop is repeated for the second scenario here.
Does this need to be scaled down as well to avoid exhausting memory?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707141238.711499-1-Arunpravin.PaneerSelvam@amd.com?part=2
next prev parent reply other threads:[~2026-07-07 14:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 14:12 [PATCH v5 1/2] gpu/buddy: replace dual-tree/force_merge with decoupled dirty tracker Arunpravin Paneer Selvam
2026-07-07 14:12 ` [PATCH v5 2/2] gpu/tests/buddy: add dirty tracker performance KUnit test Arunpravin Paneer Selvam
2026-07-07 14:24 ` sashiko-bot [this message]
2026-07-07 14:22 ` ✓ CI.KUnit: success for series starting with [v5,1/2] gpu/buddy: replace dual-tree/force_merge with decoupled dirty tracker Patchwork
2026-07-07 14:26 ` [PATCH v5 1/2] " sashiko-bot
2026-07-07 14:38 ` ✗ CI.checksparse: warning for series starting with [v5,1/2] " Patchwork
2026-07-07 15:00 ` ✓ Xe.CI.BAT: success " Patchwork
2026-07-07 16:52 ` ✓ i915.CI.BAT: " Patchwork
2026-07-07 17:27 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-08 10:37 ` ✓ i915.CI.Full: success " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2026-07-07 14:16 [PATCH v5 2/2] gpu/tests/buddy: add dirty tracker performance KUnit test Arunpravin Paneer Selvam
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=20260707142428.D415F1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Arunpravin.PaneerSelvam@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.