From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
To: David Gow <david@davidgow.net>
Cc: "Christian König" <christian.koenig@amd.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Matthew Brost" <matthew.brost@intel.com>,
"Philipp Stanner" <phasta@kernel.org>,
"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-dev@igalia.com, kunit-dev@googlegroups.com
Subject: Re: [PATCH] drm/sched: Increase drm_mock_sched_job_wait_finished timeout when CONFIG_HZ=100
Date: Mon, 14 Sep 2026 09:49:31 +0100 [thread overview]
Message-ID: <b4f017cc-3dbf-416c-b456-0c19d2f0647a@igalia.com> (raw)
In-Reply-To: <20260913084155.520015-2-david@davidgow.net>
On 13/09/2026 09:41, David Gow wrote:
> The drm_sched_scheduler_overhead_tests tests hardcode a timeout of 5x
> total_us, and fail if it's exceeded. However, on systems with
> CONFIG_HZ < 250, this tends to fail.
Systems plural or just UML? I suppose if no hrtimer support and low HZ
it is plausible since executing the tests needs 1000 x 1ms hrtimer
callbacks to fire.
Anyway, increasing the tolerance is okay-ish, with the -ish part being
that it would be even better to skip if test could know before hand on a
particular system it would be uselessly slow. Hence I am curious whether
it is just UML or you could point me to other specific platforms/kconfig
combinations where you saw it fail. In which case maybe we can come up
with a skip criteria.
Regards,
Tvrtko
> As it's possible to configure many architectures to use 100 Hz (and some,
> such as UML, hardcode CONFIG_HZ=100), increase the timeout so that the test
> doesn't fail on these configurations.
>
> Fixes: 97ef806a5314 ("drm/sched: Add some scheduling quality unit tests")
> Signed-off-by: David Gow <david@davidgow.net>
> ---
>
> This failure showed up on UML when testing the addition of CONFIG_DRM to
> the KUnit 'alltests' config[1]. Ideally, I'd like to see this test fixed
> (or at least skipped/disabled) on these broken configurations so that the
> alltests run is clean. (I don't actually run any CONFIG_HZ=100 configs
> other than UML, but fixing them all is ideal if we can manage it.)
>
> If you'd rather a different implementation / magic number, let me know.
> I picked 15 here as it gave me plenty of leeway: 10 worked most, but not
> all, of the time under i386 qemu w/ CONFIG_HZ_100, and was fine with UML
> on this machine.
>
> Thanks,
> -- David
>
> [1]: https://lore.kernel.org/all/20260911-kunit-drm-v1-1-c5c0f18fc7b0@kernel.org/
> ---
> drivers/gpu/drm/scheduler/tests/tests_scheduler.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/tests/tests_scheduler.c b/drivers/gpu/drm/scheduler/tests/tests_scheduler.c
> index 285546a2218f..02c83b5c2189 100644
> --- a/drivers/gpu/drm/scheduler/tests/tests_scheduler.c
> +++ b/drivers/gpu/drm/scheduler/tests/tests_scheduler.c
> @@ -13,6 +13,13 @@
> * logic.
> */
>
> +/* We need a more generous timeout when CONFIG_HZ=100. */
> +#if CONFIG_HZ < 250
> +#define TIMEOUT_MULTIPLIER 15
> +#else
> +#define TIMEOUT_MULTIPLIER 5
> +#endif
> +
> static int drm_sched_scheduler_init(struct kunit *test)
> {
> struct drm_mock_scheduler *sched;
> @@ -88,7 +95,7 @@ static void drm_sched_scheduler_queue_overhead(struct kunit *test)
>
> /* Wait with a safe margin to avoid every failing. */
> done = drm_mock_sched_job_wait_finished(job,
> - usecs_to_jiffies(total_us) * 5);
> + usecs_to_jiffies(total_us) * TIMEOUT_MULTIPLIER);
> end = ktime_get();
> KUNIT_ASSERT_TRUE(test, done);
>
> @@ -149,7 +156,7 @@ static void drm_sched_scheduler_ping_pong(struct kunit *test)
>
> /* Wait with a safe margin to avoid every failing. */
> done = drm_mock_sched_job_wait_finished(job,
> - usecs_to_jiffies(total_us) * 5);
> + usecs_to_jiffies(total_us) * TIMEOUT_MULTIPLIER);
> end = ktime_get();
> KUNIT_ASSERT_TRUE(test, done);
>
next prev parent reply other threads:[~2026-09-14 8:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 8:41 David Gow
2026-09-14 8:49 ` Tvrtko Ursulin [this message]
2026-09-14 10:06 ` David Gow
2026-09-14 11:21 ` Tvrtko Ursulin
2026-09-14 11:48 ` Philipp Stanner
2026-09-14 12:12 ` Tvrtko Ursulin
2026-09-14 13:33 ` David Gow
2026-09-14 9:03 ` Philipp Stanner
2026-09-14 10:07 ` David Gow
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=b4f017cc-3dbf-416c-b456-0c19d2f0647a@igalia.com \
--to=tvrtko.ursulin@igalia.com \
--cc=christian.koenig@amd.com \
--cc=dakr@kernel.org \
--cc=david@davidgow.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=phasta@kernel.org \
--cc=pierre-eric.pelloux-prayer@amd.com \
/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
all inboxes | Powered by JetHome®