Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ayubjon Qosimov" <ayubjon@amazon.de>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: "Mike Rapoport" <rppt@kernel.org>,
	linux-mm@kvack.org, "Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	nh-open-source@amazon.com
Subject: Re: [PATCH 2/5] resource, kunit: add test cases for reserve_memblock_reserved_resources()
Date: Sat, 05 Dec 2026 15:30:39 +0000	[thread overview]
Message-ID: <sashiko-outbox-251698@kernel.org> (raw)
In-Reply-To: <20261204-b4-iomem-ev5-v1-2-ccf26a176cf6@amazon.de>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] resource, kunit: unused reference tree a in
  resource_test_hint_absorbed()
--

commit 1fb74f6da0b7f065e68520a5d0823883c99a3f51
Author: Ayubjon Qosimov <ayubjon@amazon.de>

resource, kunit: add test cases for reserve_memblock_reserved_resources()

This commit exposes __reserve_region_with_split() and
__reserve_memblock_resources() to KUnit and adds an init-section KUnit
test suite in kernel/resource_kunit.c to verify hint-based resource
reservation against reserve_region_with_split().

> diff --git a/kernel/resource_kunit.c b/kernel/resource_kunit.c
> index 9eeb2b1a85c01..75d7a92a23bb5 100644
> --- a/kernel/resource_kunit.c
> +++ b/kernel/resource_kunit.c

[ ... ]

> +static void __init resource_test_hint_absorbed(struct kunit *test)
> +{
> +	/* A range that a child covers moves the hint onto that child. */
> +	static const struct hint_range root = { 0, SZ_64K - 1 };
> +	struct resource *a, *b, *pre, *hint = NULL;
> +
> +	a = hint_alloc_roots(test, &root, 1);
> +	b = hint_alloc_roots(test, &root, 1);
> +	hint_add_pre(test, a, b, 0x6000, 0x6fff);
> +	pre = b->child;
> +
> +	__reserve_region_with_split(b, 0x5000, 0x5fff, "r", &hint);
> +	KUNIT_ASSERT_NOT_NULL(test, hint);
> +	KUNIT_EXPECT_PTR_EQ(test, hint->sibling, pre);
> +	__reserve_region_with_split(b, 0x6100, 0x61ff, "r", &hint);
> +	KUNIT_EXPECT_PTR_EQ(test, hint, pre);
> +	__reserve_region_with_split(b, 0x6200, 0x62ff, "r", &hint);
> +	KUNIT_EXPECT_PTR_EQ(test, hint, pre);
> +}

[Severity: Low]
Is root a intentionally unused after hint_add_pre()?

resource_test_hint_absorbed() allocates and populates a alongside b,
consistent with the suite comment that each case builds both trees and
checks that they match, but never reserves on a or calls
hint_expect_same(test, a, b).

Mirroring the three reservations on a with reserve_region_with_split()
and calling hint_expect_same(test, a, b) would match the other cases
and the suite comment.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-iomem-ev5-v1-0-ccf26a176cf6@amazon.de?part=2


  reply	other threads:[~2026-12-05 15:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 15:29 [PATCH 0/5] Mirror reserved memblock regions in linear time Ayubjon Qosimov via B4 Relay
2026-12-04 15:29 ` [PATCH 1/5] resource: add reserve_memblock_reserved_resources() Ayubjon Qosimov via B4 Relay
2026-12-04 15:29 ` [PATCH 2/5] resource, kunit: add test cases for reserve_memblock_reserved_resources() Ayubjon Qosimov via B4 Relay
2026-12-05 15:30   ` sashiko-bot [this message]
2026-12-04 15:29 ` [PATCH 3/5] arm64: Use reserve_memblock_reserved_resources() Ayubjon Qosimov via B4 Relay
2026-12-04 15:29 ` [PATCH 4/5] riscv: use reserve_memblock_reserved_resources() Ayubjon Qosimov via B4 Relay
2026-12-04 15:29 ` [PATCH 5/5] LoongArch: Use reserve_memblock_reserved_resources() Ayubjon Qosimov via B4 Relay

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-251698@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ayubjon@amazon.de \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=nh-open-source@amazon.com \
    --cc=pjw@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=will@kernel.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