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

Use close_range where possible #758

Merged
merged 5 commits into from
Mar 7, 2022
Merged

Conversation

Furisto
Copy link
Collaborator

@Furisto Furisto commented Mar 2, 2022

Use the close_range system call to close file descriptors when creating the container. This supersedes our userspace implementation of this feature for kernels >=5.11. Close_range has better performance and does not require a mounted procfs.
More info

Signed-off-by: Furisto <24721048+Furisto@users.noreply.github.com>
Signed-off-by: Furisto <24721048+Furisto@users.noreply.github.com>
Signed-off-by: Furisto <24721048+Furisto@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #758 (8b6c80e) into main (ba9215c) will decrease coverage by 0.01%.
The diff coverage is 74.78%.

@@            Coverage Diff             @@
##             main     #758      +/-   ##
==========================================
- Coverage   72.24%   72.22%   -0.02%     
==========================================
  Files          86       86              
  Lines       11756    11792      +36     
==========================================
+ Hits         8493     8517      +24     
- Misses       3263     3275      +12     

Signed-off-by: Furisto <24721048+Furisto@users.noreply.github.com>
@YJDoc2
Copy link
Collaborator

YJDoc2 commented Mar 5, 2022

@Furisto can you try merging the main and pushing again ? utam0k has fixed the issue in #762

@Furisto
Copy link
Collaborator Author

Furisto commented Mar 6, 2022

@YJDoc2 Done

}

#[cfg(test)]
mod tests {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines +341 to +343
syscall
.close_range(preserve_fds)
.with_context(|| "failed to clean up extra fds")?;
Copy link
Member

Choose a reason for hiding this comment

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

💯

Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

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

Nice improvement!

@utam0k utam0k merged commit da36c62 into youki-dev:main Mar 7, 2022
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.

4 participants