Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sanjay Yadav" <sanjay.kumar.yadav@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/2] [CI][DONOT-REVIEW] gpu/tests/buddy: Add range-bias pruning and free-order tracking tests
Date: Sun, 11 Oct 2026 11:33:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-167180@kernel.org> (raw)
In-Reply-To: <20261011112117.1170859-4-sanjay.kumar.yadav@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] kunit: flaky test due to absolute time bound in gpu_test_buddy_range_bias_pruning
--

commit c5175de7da719ada087bdec652e790f13b219a19
Author: Sanjay Yadav <sanjay.kumar.yadav@intel.com>

gpu/tests/buddy: Add range-bias pruning and free-order tracking tests

This commit adds two KUnit cases for subtree_max_free_order and the pruning
in __alloc_range_bias(). It introduces the gpu_test_buddy_range_bias_pruning
test to reproduce the small-BAR pattern and a free-order test to validate
metadata after various block operations.

> diff --git a/drivers/gpu/tests/gpu_buddy_test.c b/drivers/gpu/tests/gpu_buddy_test.c
> index b75d32ca6ca0a..bdf480d782beb 100644
> --- a/drivers/gpu/tests/gpu_buddy_test.c
> +++ b/drivers/gpu/tests/gpu_buddy_test.c
[ ... ]
> +static void gpu_test_buddy_range_bias_pruning(struct kunit *test)
> +{
[ ... ]
> +	for (i = 0; i < nr; i++) {
> +		ktime_t start = ktime_get();
> +		u64 elapsed;
> +		int err;
> +
> +		err = gpu_buddy_alloc_blocks(&mm, 0, range_end, chunk, chunk,
> +					     &allocated, GPU_BUDDY_RANGE_ALLOCATION);
> +		elapsed = ktime_to_ns(ktime_sub(ktime_get(), start));

[Severity: Low]
Could this absolute time measurement cause spurious test failures under heavy
system load?

KUnit tests execute in environments with preemption, interrupts, and
potential scheduling delays. Measuring wall-clock time here includes all
preemption and interrupt overhead that might occur during the allocation.

[ ... ]
> +	/* The exhausted range advertises no free space, so it is pruned */
> +	block = gpu_test_find_block(&mm, 0, ilog2(range_end / chunk));
> +	KUNIT_ASSERT_NOT_NULL(test, block);
> +	KUNIT_EXPECT_EQ(test, block->subtree_max_free_order, GPU_BUDDY_NO_FREE_ORDER);
> +	gpu_test_check_free_order(test, &mm);
> +
> +	/* Per-allocation cost must not grow with the number of allocated blocks */
> +	KUNIT_EXPECT_LE(test, last_ns, 8 * first_ns + 50 * NSEC_PER_MSEC);

[Severity: Low]
Does this strict time bound make the test flaky?

Asserting on absolute wall-clock time differences (adding a strict 50ms
allowance) is prone to spurious failures when the system is under load or
when the test thread is preempted between the start and end of the timing
windows.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261011112117.1170859-3-sanjay.kumar.yadav@intel.com?part=2

  reply	other threads:[~2026-10-11 11:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 11:21 [PATCH 1/2] [CI][DONOT-REVIEW] gpu/buddy: Prune exhausted subtrees in range-biased allocation Sanjay Yadav
2026-10-11 11:21 ` [PATCH 2/2] [CI][DONOT-REVIEW] gpu/tests/buddy: Add range-bias pruning and free-order tracking tests Sanjay Yadav
2026-10-11 11:33   ` sashiko-bot [this message]
2026-10-11 11:35 ` ✓ CI.KUnit: success for series starting with [1/2,CI,DONOT-REVIEW] gpu/buddy: Prune exhausted subtrees in range-biased allocation Patchwork
2026-10-11 12:13 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-11 13:26 ` ✗ Xe.CI.FULL: failure " Patchwork

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-167180@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sanjay.kumar.yadav@intel.com \
    --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