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

lib/uksched: Do not save/restore ECTX on coop thread switching #1570

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

Conversation

mogasergiu
Copy link
Member

@mogasergiu mogasergiu commented Jan 27, 2025

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Base target

  • Architecture(s): N/A
  • Platform(s): N/A
  • Application(s): N/A

Additional configuration

Description of changes

Since we only have cooperative scheduling at the moment, saving/restoring ECTX when thread switching is not necessary, since the ABI treats these registers as scratch registers and thread switching essentially happens through actual explicit function calls.

On the other hand, this is obviously not the case with preemptive scheduling since thread switching can happen out of the blue, typically on a timer IRQ, so then ECTX saving/restoring is definetely necessary.

But, again, we are only doing cooperative scheduling at the moment and this operation adds unnecessary overhead so throw it out.

Since we only have cooperative scheduling at the moment, saving/restoring
ECTX when thread switching is not necessary, since the ABI treats these
registers as scratch registers and thread switching essentially
happens through actual explicit function calls.

On the other hand, this is obviously not the case with preemptive
scheduling since thread switching can happen out of the blue,
typically on a timer IRQ, so then ECTX saving/restoring is definetely
necessary.

But, again, we are only doing cooperative scheduling at the moment and
this operation adds unnecessary overhead so throw it out.

Signed-off-by: Sergiu Moga <[email protected]>
@github-actions github-actions bot added area/lib Internal Unikraft Microlibrary lib/uksched labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lib Internal Unikraft Microlibrary lib/uksched
Projects
Status: 🧊 Icebox
Development

Successfully merging this pull request may close these issues.

2 participants