From: sashiko-bot@kernel.org
To: "Arunpravin Paneer Selvam" <Arunpravin.PaneerSelvam@amd.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v11 2/2] gpu/tests/buddy: add dirty tracker performance KUnit test
Date: Tue, 25 Aug 2026 17:32:11 +0000 [thread overview]
Message-ID: <20260825173212.229CF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825172432.80355-2-Arunpravin.PaneerSelvam@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Dynamically allocated kernel memory leaks if a KUnit assertion fails during block allocation.
--
commit b7e7a71f5be8a7ec99f348cd4b1b9f77122e136f
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 benefits of
the decoupled dirty-tracker design over the old approach. The test runs two
scenarios on a 4 GiB pool with alternating fragmentation and measures block
allocation throughput.
> diff --git a/drivers/gpu/tests/gpu_buddy_test.c b/drivers/gpu/tests/gpu_buddy_test.c
> index 6ce485eae83ee..b75d32ca6ca0a 100644
> --- a/drivers/gpu/tests/gpu_buddy_test.c
> +++ b/drivers/gpu/tests/gpu_buddy_test.c
[ ... ]
> @@ -283,6 +283,121 @@ static void gpu_test_buddy_fragmentation_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 leak dynamically allocated kernel memory if the test assertion
fails during block allocation?
The test performs 1,048,576 allocations in this loop. If any of these fail
(for instance, due to system memory pressure), KUNIT_ASSERT_FALSE_MSG
triggers and immediately aborts execution. Because there are no deferred
cleanup handlers registered, all previously allocated buddy blocks in the
local lists and internal structures allocated by gpu_buddy_init() are
permanently leaked.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260825172432.80355-1-Arunpravin.PaneerSelvam@amd.com?part=2
next prev parent reply other threads:[~2026-08-25 17:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 17:24 [PATCH v11 1/2] gpu/buddy: replace dual-tree/force_merge with decoupled dirty tracker Arunpravin Paneer Selvam
2026-08-25 17:24 ` [PATCH v11 2/2] gpu/tests/buddy: add dirty tracker performance KUnit test Arunpravin Paneer Selvam
2026-08-25 17:32 ` sashiko-bot [this message]
2026-08-25 17:38 ` [PATCH v11 1/2] gpu/buddy: replace dual-tree/force_merge with decoupled dirty tracker sashiko-bot
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=20260825173212.229CF1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Arunpravin.PaneerSelvam@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox