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

fix a memory subsystem #36

Merged
merged 4 commits into from
May 26, 2021
Merged

fix a memory subsystem #36

merged 4 commits into from
May 26, 2021

Conversation

utam0k
Copy link
Member

@utam0k utam0k commented May 26, 2021

I ran it with Docker and youki at local, and it didn't work because it tried to set 0, so I fixed it.
https://github.com/opencontainers/runc/blob/3f6594675675d4e88901c782462f56497260b1d2/libcontainer/cgroups/fs/memory.go#L40-L42

@utam0k utam0k requested a review from tsturzl May 26, 2021 07:28
@utam0k
Copy link
Member Author

utam0k commented May 26, 2021

@tsturzl
I would like you to review this.

@utam0k utam0k changed the title fix memory subsystem fix a memory subsystem May 26, 2021
Copy link
Collaborator

@tsturzl tsturzl left a comment

Choose a reason for hiding this comment

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

Just curious about the unwrap_or_else instead of expect, otherwise looks good.

src/cgroups/blkio.rs Show resolved Hide resolved
@@ -158,16 +161,16 @@ impl Memory {
Errno::EBUSY => {
let usage = Self::get_memory_usage(cgroup_root)?;
let max_usage = Self::get_memory_max_usage(cgroup_root)?;
Err(anyhow!(
bail!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch, I haven't use anyhow, but this looks much cleaner.

@utam0k utam0k merged commit 9cea9af into main May 26, 2021
@utam0k utam0k deleted the fix_memory_subsystem branch May 27, 2021 06:17
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.

2 participants