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

vm_arm: add priority in vm config struct #69

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

Conversation

axel-h
Copy link
Member

@axel-h axel-h commented Mar 10, 2023

Adds the priorities to the vm config struct from the template. Is also makes VM_INIT_DEF use 100 as default base priority, so there is no need to explicitly specify anything. It also support the _priority. However, I wonder if we should clean this up an rename it to ìrqserver_prio`in the attribute also in a follow-up task

@axel-h axel-h force-pushed the patch-axel-19 branch 2 times, most recently from 78628ad to f8e29e7 Compare March 13, 2023 12:37
hlyytine added a commit to tiiuae/tii-sel4-vm that referenced this pull request Mar 19, 2023
Since we had forked off our completely independent versions of VM
definition and configuration macros, we could not track upstream
changes.

Configuration macro still needs the change, but is pending on
seL4/camkes-vm#69.

Signed-off-by: Hannu Lyytinen <[email protected]>
hlyytine added a commit to tiiuae/tii-sel4-vm that referenced this pull request Mar 19, 2023
Since we had forked off our completely independent versions of VM
definition and configuration macros, we could not track upstream
changes.

Configuration macro still needs the change, but is pending on
seL4/camkes-vm#69.

Signed-off-by: Hannu Lyytinen <[email protected]>
@axel-h axel-h force-pushed the patch-axel-19 branch 9 times, most recently from 71672c1 to 071662a Compare March 21, 2023 17:23
components/VM_Arm/src/main.c Outdated Show resolved Hide resolved
templates/seL4VMParameters.template.c Outdated Show resolved Hide resolved
templates/seL4VMParameters.template.c Outdated Show resolved Hide resolved
@hlyytine
Copy link
Contributor

Also, shouldn't you get rid of hard coded value at

vm.base_prio = 100;
(and the other one on line 35 also)?

@axel-h
Copy link
Member Author

axel-h commented Mar 24, 2023

Also, shouldn't you get rid of hard coded value at camkes-vm/components/VM_Arm/vm_common.camkes

Yes, seems this can also be removed then.

@axel-h axel-h force-pushed the patch-axel-19 branch 4 times, most recently from 67883a6 to dd8c84a Compare March 30, 2023 10:41
Copy link
Contributor

@hlyytine hlyytine left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -30,9 +30,6 @@ assembly {
vm.cnode_size_bits = 23;
vm.simple_untyped24_pool = 12;

vm.base_prio = 100;

vm._priority = 101;
Copy link
Member

@kent-mcleod kent-mcleod Apr 10, 2023

Choose a reason for hiding this comment

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

_priority has a special meaning as the priority for the thread that calls run

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, worth to add this in a comment. But shouldn't this be 100 then?

Copy link
Member

Choose a reason for hiding this comment

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

If the VMM threads aren't a higher priority than the vm thread, the vm won't be preempted when there's work to be done in the VMM which affects things like IRQ latency.

Copy link
Member Author

Choose a reason for hiding this comment

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

But the "VM Thread" is the vCPU thread, right? This is supposed to run at "basePrio - 1".

Copy link
Contributor

Choose a reason for hiding this comment

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

Check for vcpu_prio < base_prio && vcpu_prio < irqserver_prio is missing in that Jinja template. Probably that's what @kent-mcleod meant?

Copy link
Member

Choose a reason for hiding this comment

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

I guess it could still be up to someone to choose to configure the vmm and vcpu threads with the same priority if they wanted to delay things like IRQ injection until the vcpu thread was preempted or yielded, but in general, it's probably most straight forward if the irq server threads have equal or higher prio to vmm thread, which has higher prio to vcpu threads.

@axel-h axel-h force-pushed the patch-axel-19 branch 2 times, most recently from 8ec23e8 to 6992b29 Compare April 16, 2023 19:22
@axel-h axel-h marked this pull request as draft April 16, 2023 19:22
@axel-h axel-h force-pushed the patch-axel-19 branch 4 times, most recently from 381b9fb to 630b177 Compare April 20, 2023 11:23
- Cleanup the definitions.
- Set a default base value for the attribute.
- Derive the other priorities in the config params template.
- Do sanity check during template processing.

Signed-off-by: Axel Heider <[email protected]>
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.

3 participants