All of lore.kernel.org
 help / color / mirror / Atom feed
* [libevl][PATCH] tests: sched-quota: Perform calibration without quota again
@ 2026-08-31 14:56 Jan Kiszka
  2026-09-04  9:22 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2026-08-31 14:56 UTC (permalink / raw)
  To: Xenomai, Philippe Gerum

From: Jan Kiszka <jan.kiszka@siemens.com>

It defeats the purpose of the test when we calibrate under quota as we
can no longer compare the actual cap against the configured value.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 tests/sched-quota-accuracy.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/sched-quota-accuracy.c b/tests/sched-quota-accuracy.c
index 1bf5eb9..ac04449 100644
--- a/tests/sched-quota-accuracy.c
+++ b/tests/sched-quota-accuracy.c
@@ -171,15 +171,15 @@ static void *quota_thread(void *arg)
 	__Tcall_assert(t->efd, evl_attach_self("quota-runner:%d.%d",
 						getpid(), serial));
 
+	wait_phase(calibration_phase);
+
+	do_work(t, PERIOD_NS * NR_PERIODS);
+
 	attrs.sched_policy = SCHED_QUOTA;
 	attrs.sched_priority = QUOTA_PRIO;
 	attrs.sched_quota_group = tgid;
 	__Tcall_assert(ret, evl_set_schedattr(t->efd, &attrs));
 
-	wait_phase(calibration_phase);
-
-	do_work(t, PERIOD_NS * NR_PERIODS);
-
 	wait_phase(accuracy_measurement_phase);
 
 	do_work(t, PERIOD_NS * NR_PERIODS);
@@ -338,7 +338,8 @@ static struct accuracy_results run_quota(void)
 	 * expressed as a percentage. The closest to the QUOTA_PERCENT
 	 * target, the better.
 	 */
-	results.accuracy = ((double)loops_at_accuracy * 100.0) / (double)loops_at_calibration;
+	results.accuracy = 100.0 *
+		((double)loops_at_accuracy * 100.0 / QUOTA_PERCENT) / (double)loops_at_calibration;
 
 	/*
 	 * Level of noise observed for the disrupted run compared to
@@ -346,7 +347,8 @@ static struct accuracy_results run_quota(void)
 	 * run was faster than the calibration one, which would still
 	 * be correct.
 	 */
-	results.noise = 100.0 - (((double)loops_with_disruption * 100.0) / (double)loops_at_calibration);
+	results.noise = 100.0 - (100.0 *
+		((double)loops_with_disruption * 100.0 / QUOTA_PERCENT) / (double)loops_at_calibration);
 
 	__Tcall_assert(ret, cleanup_group());
 
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [libevl][PATCH] tests: sched-quota: Perform calibration without quota again
  2026-08-31 14:56 [libevl][PATCH] tests: sched-quota: Perform calibration without quota again Jan Kiszka
@ 2026-09-04  9:22 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2026-09-04  9:22 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Xenomai

Jan Kiszka <jan.kiszka@siemens.com> writes:

> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> It defeats the purpose of the test when we calibrate under quota as we
> can no longer compare the actual cap against the configured value.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  tests/sched-quota-accuracy.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/tests/sched-quota-accuracy.c b/tests/sched-quota-accuracy.c
> index 1bf5eb9..ac04449 100644
> --- a/tests/sched-quota-accuracy.c
> +++ b/tests/sched-quota-accuracy.c
> @@ -171,15 +171,15 @@ static void *quota_thread(void *arg)
>  	__Tcall_assert(t->efd, evl_attach_self("quota-runner:%d.%d",
>  						getpid(), serial));
>  
> +	wait_phase(calibration_phase);
> +
> +	do_work(t, PERIOD_NS * NR_PERIODS);
> +
>  	attrs.sched_policy = SCHED_QUOTA;
>  	attrs.sched_priority = QUOTA_PRIO;
>  	attrs.sched_quota_group = tgid;
>  	__Tcall_assert(ret, evl_set_schedattr(t->efd, &attrs));
>  
> -	wait_phase(calibration_phase);
> -
> -	do_work(t, PERIOD_NS * NR_PERIODS);
> -
>  	wait_phase(accuracy_measurement_phase);
>  
>  	do_work(t, PERIOD_NS * NR_PERIODS);
> @@ -338,7 +338,8 @@ static struct accuracy_results run_quota(void)
>  	 * expressed as a percentage. The closest to the QUOTA_PERCENT
>  	 * target, the better.
>  	 */
> -	results.accuracy = ((double)loops_at_accuracy * 100.0) / (double)loops_at_calibration;
> +	results.accuracy = 100.0 *
> +		((double)loops_at_accuracy * 100.0 / QUOTA_PERCENT) / (double)loops_at_calibration;
>  
>  	/*
>  	 * Level of noise observed for the disrupted run compared to
> @@ -346,7 +347,8 @@ static struct accuracy_results run_quota(void)
>  	 * run was faster than the calibration one, which would still
>  	 * be correct.
>  	 */
> -	results.noise = 100.0 - (((double)loops_with_disruption * 100.0) / (double)loops_at_calibration);
> +	results.noise = 100.0 - (100.0 *
> +		((double)loops_with_disruption * 100.0 / QUOTA_PERCENT) / (double)loops_at_calibration);
>  
>  	__Tcall_assert(ret, cleanup_group());

Merged, thanks.

-- 
Philippe.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-04  9:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 14:56 [libevl][PATCH] tests: sched-quota: Perform calibration without quota again Jan Kiszka
2026-09-04  9:22 ` Philippe Gerum

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.