Skip to content

cgroup refactoring#2387

Merged
kolyshkin merged 8 commits into
opencontainers:masterfrom
kolyshkin:g-knot-prepare
May 8, 2020
Merged

cgroup refactoring#2387
kolyshkin merged 8 commits into
opencontainers:masterfrom
kolyshkin:g-knot-prepare

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin commented May 8, 2020

This is a set of patches aiming to prepare the codebase for #2386

Please review commits one by one.

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented May 8, 2020

Looks fine but needs rebase.

@kolyshkin
Copy link
Copy Markdown
Contributor Author

Rebased

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented May 8, 2020

LGTM

Approved with PullApprove

@kolyshkin
Copy link
Copy Markdown
Contributor Author

rebased again :)

Comment thread libcontainer/cgroups/fs/apply_raw.go Outdated
Comment thread libcontainer/cgroups/systemd/v1.go Outdated
@AkihiroSuda
Copy link
Copy Markdown
Member

Looks good but a couple of nits

kolyshkin added 8 commits May 8, 2020 10:05
Instead of passing the whole map of paths, pass the path to the memory
controller which these functions actually require.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
c.cgroupManager.GetPaths() are called twice here: once in currentState()
and then in newSetnsProcess(). Reuse the result of the first call, which
is stored into state.CgroupPaths.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
...and use it from libcontainer/factory_linux.go.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This was generated entirely by gorename -- nothing to review here.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This patch was generated entirely by gorename -- nothing to review here.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. Prevent theoretical "concurrent map access" error to m.paths.

2. There is no need to call m.Paths -- we can access m.paths directly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@AkihiroSuda
Copy link
Copy Markdown
Member

AkihiroSuda commented May 8, 2020

LGTM

Approved with PullApprove

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented May 8, 2020

LGTM

Approved with PullApprove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants