Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update runc to 9c2d8d184e5da67c95d601382adf14862e4f2228#31736

Merged
vdemeester merged 1 commit intomoby:mastermoby/moby:masterfrom
mlaventure:update-runcmlaventure/docker:update-runcCopy head branch name to clipboard
Mar 12, 2017
Merged

Update runc to 9c2d8d184e5da67c95d601382adf14862e4f2228#31736
vdemeester merged 1 commit intomoby:mastermoby/moby:masterfrom
mlaventure:update-runcmlaventure/docker:update-runcCopy head branch name to clipboard

Conversation

@mlaventure
Copy link
Copy Markdown
Contributor

This fix a conflict with systemd daemon-reload (see
opencontainers/runc#1344)

Signed-off-by: Kenfe-Mickael Laventure mickael.laventure@gmail.com

--

Closes #30121

diff --git a/libcontainer/cgroups/systemd/apply_systemd.go b/libcontainer/cgroups/systemd/apply_systemd.go
index fd428f9..7ce066c 100644
--- a/libcontainer/cgroups/systemd/apply_systemd.go
+++ b/libcontainer/cgroups/systemd/apply_systemd.go
@@ -269,6 +269,13 @@ func (m *Manager) Apply(pid int) error {
                        newProp("CPUShares", uint64(c.Resources.CpuShares)))
        }
 
+       // cpu.cfs_quota_us and cpu.cfs_period_us are controlled by systemd.
+       if c.Resources.CpuQuota != 0 && c.Resources.CpuPeriod != 0 {
+               cpuQuotaPerSecUSec := c.Resources.CpuQuota * 1000000 / c.Resources.CpuPeriod
+               properties = append(properties,
+                       newProp("CPUQuotaPerSecUSec", uint64(cpuQuotaPerSecUSec)))
+       }
+
        if c.Resources.BlkioWeight != 0 {
                properties = append(properties,
                        newProp("BlockIOWeight", uint64(c.Resources.BlkioWeight)))

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

This fix a conflict with systemd daemon-reload (see
opencontainers/runc#1344)

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
@vieux
Copy link
Copy Markdown
Contributor

vieux commented Mar 10, 2017

rebased.

@mlaventure
Copy link
Copy Markdown
Contributor Author

Thanks!

@vdemeester vdemeester merged commit 613334e into moby:master Mar 12, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.04.0 milestone Mar 12, 2017
@mlaventure mlaventure deleted the update-runc branch March 13, 2017 17:07
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.

when docker use --cpu-quota and systemd daemon-reload, old container's cpu.cfs_quota_us become -1

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.