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

sched/task_[posix]spawn: Simplify how spawn attributes are handled #11032

Merged
merged 1 commit into from Oct 25, 2023

Conversation

pussuw
Copy link
Contributor

@pussuw pussuw commented Oct 25, 2023

Summary

Handle task spawn attributes as task spawn file actions are handled.

Why? This removes the need for sched_lock() when the task is being spawned. When loading the new task from a file the scheduler can be locked for a VERY LONG time, in the order of hundreds of milliseconds!

This is unacceptable for real time operation.

Also fixes a latent bug in exec_module, spawn_file_actions is executed at a bad location; when CONFIG_ARCH_ADDRENV=y actions will point to the new process's address environment (as it is temporarily instantiated at that point). Fix this by moving it to after addrenv_restore.

Impact

Unify task spawn attribute and file operation handling, remove massive sched_lock.

Testing

qemu (rv-virt:knsh64) and MPFS target with >100 processes (CONFIG_BUILD_KERNEL).

Handle task spawn attributes as task spawn file actions are handled.

Why? This removes the need for sched_lock() when the task is being
spawned. When loading the new task from a file the scheduler can be
locked for a VERY LONG time, in the order of hundreds of milliseconds!

This is unacceptable for real time operation.

Also fixes a latent bug in exec_module, spawn_file_actions is executed
at a bad location; when CONFIG_ARCH_ADDRENV=y actions will point to the
new process's address environment (as it is temporarily instantiated at
that point). Fix this by moving it to after addrenv_restore.
@acassis acassis merged commit ab78e38 into apache:master Oct 25, 2023
26 checks passed
@pussuw pussuw deleted the spawn_code_simplify branch October 25, 2023 15:53
@pussuw pussuw restored the spawn_code_simplify branch October 26, 2023 13:02
@pussuw pussuw deleted the spawn_code_simplify branch October 26, 2023 13:42
@jerpelea jerpelea added this to To-Add in Release Notes - 12.4.0 Dec 27, 2023
@jerpelea jerpelea moved this from To-Add to core in Release Notes - 12.4.0 Jan 8, 2024
@jerpelea jerpelea moved this from core to processed in Release Notes - 12.4.0 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants