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

feat: Suspend support in spawn syscalls #3996

Merged
merged 14 commits into from
Jun 7, 2023
Merged

Conversation

xxuejie
Copy link
Collaborator

@xxuejie xxuejie commented May 31, 2023

What problem does this PR solve?

This PR fixes a bug that when suspend happens when a child machine created by the spawn syscall is running, CKB cannot correctly suspend & resume the VM.

What is changed and how it works?

What's Changed: the bug relating spawn syscall and suspend / resume feature is fixed.

Related changes

  • PR to update owner/repo:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

@xxuejie xxuejie requested a review from a team as a code owner May 31, 2023 05:47
@xxuejie xxuejie requested review from doitian and removed request for a team May 31, 2023 05:47
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/verify.rs Outdated Show resolved Hide resolved
xxuejie and others added 2 commits June 5, 2023 22:05
Co-authored-by: Eval EXEC <execvy@gmail.com>
Co-authored-by: Eval EXEC <execvy@gmail.com>
@eval-exec eval-exec added the t:enhancement Type: Feature, refactoring. label Jun 6, 2023
callee_peak_memory: u64,
callee_memory_limit: u64,
content: Vec<u8>,
content_length: u64,
Copy link
Contributor

@XuJiandong XuJiandong Jun 6, 2023

Choose a reason for hiding this comment

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

The inclusion of content_length is unnecessary. This is because once the child script invokes set_content, the content size whether truncated or otherwise, is already known.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm looking at a different angle: this is required to build this syscall used by a child. We don't know that whether a child machine has invoked set_content or not when suspended, so I believe this is required to build the full environment for a child machine.

@xxuejie
Copy link
Collaborator Author

xxuejie commented Jun 6, 2023

@eval-exec Personally I don't think this PR is an enhancement. To me the previous spawn implementation has a bug when used with the suspend / resume feature. This PR fixes the bug.

@eval-exec eval-exec removed the t:enhancement Type: Feature, refactoring. label Jun 6, 2023
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/types.rs Outdated Show resolved Hide resolved
@xxuejie xxuejie requested a review from XuJiandong June 6, 2023 03:23
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/verify.rs Outdated Show resolved Hide resolved
script/src/types.rs Outdated Show resolved Hide resolved
xxuejie and others added 5 commits June 6, 2023 15:07
Co-authored-by: Quake Wang <quake.wang@gmail.com>
Co-authored-by: Quake Wang <quake.wang@gmail.com>
Co-authored-by: Quake Wang <quake.wang@gmail.com>
Co-authored-by: Quake Wang <quake.wang@gmail.com>
Copy link
Member

@quake quake left a comment

Choose a reason for hiding this comment

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

LGTM, please update the PR description.

@xxuejie
Copy link
Collaborator Author

xxuejie commented Jun 6, 2023

LGTM, please update the PR description.

Already updated.

@quake quake added this pull request to the merge queue Jun 7, 2023
Merged via the queue into develop with commit cb89047 Jun 7, 2023
@doitian doitian deleted the suspend-support-in-spawn-calls branch January 29, 2024 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants