From: sashiko-bot@kernel.org
To: "Emerson Busson" <emersonbusson@gmail.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v2 11/14] hv: vmbus: vmalloc requestor metadata
Date: Thu, 08 Oct 2026 19:09:34 +0000 [thread overview]
Message-ID: <sashiko-outbox-164495@kernel.org> (raw)
In-Reply-To: <20261007190752.336426-12-emersonbusson@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] hv: memory leak in vmbus KUnit tests on KUNIT_ASSERT_EQ failure
--
commit 691cb947fd6eb3bbd5abcb1f0c1c8a97f9b7e21e
Author: Emerson Busson <emersonbusson@gmail.com>
hv: vmbus: vmalloc requestor metadata
This commit changes the channel open requestor array and bitmap allocations
from kvcalloc and bitmap_zalloc to vzalloc to avoid high-order allocations
under memory fragmentation, and adds KUnit tests for these structures.
> diff --git a/drivers/hv/vmbus_buffer_test.c b/drivers/hv/vmbus_buffer_test.c
> index 5c8e70d861adb..d0102dabef737 100644
> --- a/drivers/hv/vmbus_buffer_test.c
> +++ b/drivers/hv/vmbus_buffer_test.c
[ ... ]
> +static void vmbus_requestor_invalid_ids_test(struct kunit *test)
> +{
> + struct vmbus_channel channel = { .rqstor_size = 4 };
> + struct vmbus_requestor *rqstor = &channel.requestor;
> + u64 id, addr;
> +
> + KUNIT_ASSERT_EQ(test, vmbus_alloc_requestor(rqstor, 4), 0);
> +
> + /* ID 0 is the unsolicited-message sentinel and is never in the set. */
> + KUNIT_EXPECT_EQ(test, vmbus_request_addr_match(&channel, 0, 0),
> + VMBUS_RQST_ERROR);
> +
> + /* Out-of-range IDs are refused, not wrapped. */
> + KUNIT_EXPECT_EQ(test, vmbus_request_addr_match(&channel, 5, 0),
> + VMBUS_RQST_ERROR);
> + KUNIT_EXPECT_EQ(test, vmbus_request_addr_match(&channel, U64_MAX, 0),
> + VMBUS_RQST_ERROR);
> +
> + id = vmbus_next_request_id(&channel, 0xABCD);
> + KUNIT_ASSERT_EQ(test, id, 1U);
[Severity: Low]
Does this abort the test and skip the cleanup on failure?
In vmbus_requestor_invalid_ids_test(), vmbus_alloc_requestor() is called
earlier to allocate the vmalloc-backed metadata arrays. If this
KUNIT_ASSERT_EQ() fails, KUnit immediately aborts the execution of the test
function.
This would skip the manual cleanup call to vmbus_free_requestor() at the
end of the function, resulting in a memory leak of the requestor arrays.
Could this be changed to use KUNIT_EXPECT_EQ(), which reports the failure
but continues execution, or could a deferred cleanup action be registered
with KUnit?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261007190752.336426-1-emersonbusson@gmail.com?part=11
next prev parent reply other threads:[~2026-10-08 19:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 19:07 [PATCH v2 0/14] hv: vmbus: make rings and host-visible buffers survive buddy fragmentation Emerson Busson
2026-10-07 19:07 ` [PATCH v2 01/14] hv: vmbus: convert ring backing through the chunk allocator Emerson Busson
2026-10-07 19:07 ` [PATCH v2 02/14] hv: vmbus: validate chunk buffer allocation and cleanup Emerson Busson
2026-10-08 21:17 ` kernel test robot
2026-10-07 19:07 ` [PATCH v2 03/14] uio: hv_generic: describe buffers for owned allocation Emerson Busson
2026-10-07 19:07 ` [PATCH v2 04/14] hv: vmbus: add KUnit tests for GPADL post failure injection Emerson Busson
2026-10-07 19:07 ` [PATCH v2 05/14] hv: vmbus: add KUnit test for order-zero allocation fallback Emerson Busson
2026-10-07 19:07 ` [PATCH v2 06/14] hv: vmbus: cover all shared-page policy combinations Emerson Busson
2026-10-07 19:07 ` [PATCH v2 07/14] hv: vmbus: distinguish host rescind from local channel unload Emerson Busson
2026-10-07 19:07 ` [PATCH v2 08/14] hv: vmbus: retain backing until ownership and references clear Emerson Busson
2026-10-08 19:09 ` sashiko-bot
2026-10-07 19:07 ` [PATCH v2 09/14] hv: use owned VMBus buffers in NetVSC and UIO Emerson Busson
2026-10-08 19:09 ` sashiko-bot
2026-10-07 19:07 ` [PATCH v2 10/14] hv: vmbus: pin buffer pages across UIO mmap to close the reclaim race Emerson Busson
2026-10-08 16:49 ` kernel test robot
2026-10-08 17:51 ` Nathan Chancellor
2026-10-08 17:02 ` kernel test robot
2026-10-08 19:09 ` sashiko-bot
2026-10-07 19:07 ` [PATCH v2 11/14] hv: vmbus: vmalloc requestor metadata Emerson Busson
2026-10-08 19:09 ` sashiko-bot [this message]
2026-10-07 19:07 ` [PATCH v2 12/14] hv: netvsc: allocate RNDIS request descriptors with kvzalloc_obj() Emerson Busson
2026-10-08 19:09 ` sashiko-bot
2026-10-07 19:07 ` [PATCH v2 13/14] hv: netvsc: handle a NULL request address on empty completions Emerson Busson
2026-10-08 19:09 ` sashiko-bot
2026-10-07 19:07 ` [PATCH v2 14/14] hv: netvsc: use kvzalloc for device state Emerson Busson
2026-10-08 19:09 ` sashiko-bot
2026-10-08 16:55 ` [PATCH v2 0/14] hv: vmbus: make rings and host-visible buffers survive buddy fragmentation Easwar Hariharan
2026-10-13 17:52 ` Michael Kelley
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=sashiko-outbox-164495@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=emersonbusson@gmail.com \
--cc=linux-hyperv@vger.kernel.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.