ovni/doc/user/emulation/nosv.md
Rodrigo Arias 4b4f1bd218 Don't modify nOS-V subsystem state on task pause
In nOS-V, when a task was paused via the VTp event, two things were
happening: 1) the task state was set to pause and 2) the subsystem state
"Task: Running" was being popped.

This causes a problem when a task calls nosv_submit() in blocking mode,
as it will call nosv_pause() which will emit a VTp event from a
subsystem different than "Task: Running".

To solve this conflict, we handle the subsystems state and the task
state separately with the VTp and VTr events. The subsystem state "Task:
Running" no longer is connected to the state of the task and only shows
if we entered the body of the task or not. It has now been renamed to
"Task: In body".

The new state "Task: In body" represents that the task body has begun
the execution and is still in the stack, but the task may be paused. The
subsystem is not changed by the VTp (pause) or VTr (resume) events.

Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/128
2023-10-23 11:26:17 +02:00

31 lines
1.1 KiB
Markdown

# nOS-V model
The nOS-V runtime is composed of tasks that can be scheduled to run in
threads. Tasks can be paused and resumed, leaving the CPUs free to
execute other tasks. The nOS-V model tracks the state of each task as
well as the state of the runtime internal state.
## Task type colors
In the Paraver timeline, the color assigned to each nOS-V task type is
computed from the task type label using a hash function; the task type
id doesn't affect in any way how the color gets assigned. This method
provides two desirable properties:
- Invariant type colors over time: the order in which task types are
created doesn't affect their color.
- Deterministic colors among threads: task types with the same label end
up mapped to the same color, even if they are from different threads
located in different nodes.
For more details, see [this MR][1].
[1]: https://pm.bsc.es/gitlab/rarias/ovni/-/merge_requests/27
## Subsystem view
The subsystem view provides a simplified view on what is the nOS-V
runtime doing over time. The view follows the same rules described in
the [subsystem view of Nanos6](../nanos6/#subsystem_view).