Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCS: Add periodic drift test #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Indanz
Copy link
Contributor

@Indanz Indanz commented Jun 2, 2022

If this test fails, TIMER_OVERHEAD_TICKS may not be set correctly
for the platform. Needs seL4 pull #847 applied to pass.

Signed-off-by: Indan Zupancic [email protected]

If this test fails, TIMER_OVERHEAD_TICKS may not be set correctly
for the platform. Needs seL4 pull #847 applied to pass.

Signed-off-by: Indan Zupancic <[email protected]>
@Indanz
Copy link
Contributor Author

Indanz commented Jun 2, 2022

Without seL4/seL4#847 this fails with 2498 and 2494 for SMP instead of the expected 2500 on tqma8xqp1gb.

Copy link
Member

@kent-mcleod kent-mcleod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this right, the main thread sleeps for (1 second - half-a-period = 1 - 0.000002s) which should guarantee that each of the child threads should be allowed to yield exactly (1 second / period = 2500) times. This means that if a period drifts by more than 80ns for each activation on average the test will fail, but if it's less than 80ns it will pass?

@Indanz
Copy link
Contributor Author

Indanz commented Jun 3, 2022

Correct. The test can be made less strict by reducing the sleep time.

/* Create tasks with lower priority: */
for (int i = 0; i < num_threads; i++) {
create_helper_thread(env, &t[i]);
set_helper_priority(env, &t[i], env->priority - 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add an assert here that this does not cause a roll over.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. test_timeout_fault_in_server does OUR_PRIO - 2, and #define OUR_PRIO (env->priority). It seems priority is set to seL4_MaxPrio - 1 in main.c.

@axel-h
Copy link
Member

axel-h commented Nov 7, 2022

If I understand this right, the main thread sleeps for (1 second - half-a-period = 1 - 0.000002s) which should guarantee that each of the child threads should be allowed to yield exactly (1 second / period = 2500) times. This means that if a period drifts by more than 80ns for each activation on average the test will fail, but if it's less than 80ns it will pass?

@Indanz Could you add this as a comment that describes the test's details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants