Skip to content

Commit 7c55330

Browse files
committed
Add cgroup1
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
1 parent 3e546aa commit 7c55330

36 files changed

+333
-306
lines changed

blkio.go cgroup1/blkio.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"bufio"

blkio_test.go cgroup1/blkio_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

cgroup.go cgroup1/cgroup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"errors"

cgroup_test.go cgroup1/cgroup_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"fmt"

control.go cgroup1/control.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

cpu.go cgroup1/cpu.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"bufio"

cpuacct.go cgroup1/cpuacct.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"bufio"

cpuacct_test.go cgroup1/cpuacct_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

cpuset.go cgroup1/cpuset.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"bytes"

devices.go cgroup1/devices.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"fmt"

errors.go cgroup1/errors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"errors"

freezer.go cgroup1/freezer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

hierarchy.go cgroup1/hierarchy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
// Hierarchy enables both unified and split hierarchy for cgroups
2020
type Hierarchy func() ([]Subsystem, error)

hugetlb.go cgroup1/hugetlb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

memory.go cgroup1/memory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"bufio"

memory_test.go cgroup1/memory_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"fmt"

mock_test.go cgroup1/mock_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

named.go cgroup1/named.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import "path/filepath"
2020

named_test.go cgroup1/named_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import "testing"
2020

net_cls.go cgroup1/net_cls.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

net_prio.go cgroup1/net_prio.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"fmt"

opts.go cgroup1/opts.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"errors"

paths.go cgroup1/paths.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"errors"

paths_test.go cgroup1/paths_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

perf_event.go cgroup1/perf_event.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import "path/filepath"
2020

pids.go cgroup1/pids.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"os"

pids_test.go cgroup1/pids_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"encoding/hex"

rdma.go cgroup1/rdma.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"math"

state.go cgroup1/state.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
// State is a type that represents the state of the current cgroup
2020
type State string

subsystem.go cgroup1/subsystem.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"fmt"
2121
"os"
2222

23+
"github.com/containerd/cgroups/v2"
2324
v1 "github.com/containerd/cgroups/v2/stats/v1"
2425
specs "github.com/opencontainers/runtime-spec/specs-go"
2526
)
@@ -59,7 +60,7 @@ func Subsystems() []Name {
5960
Blkio,
6061
Rdma,
6162
}
62-
if !RunningInUserNS() {
63+
if !cgroups.RunningInUserNS() {
6364
n = append(n, Devices)
6465
}
6566
if _, err := os.Stat("/sys/kernel/mm/hugepages"); err == nil {

systemd.go cgroup1/systemd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"context"

testutil_test.go cgroup1/testutil_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
import (
2020
"golang.org/x/sys/unix"

ticks.go cgroup1/ticks.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package cgroups
17+
package cgroup1
1818

1919
func getClockTicks() uint64 {
2020
// The value comes from `C.sysconf(C._SC_CLK_TCK)`, and

0 commit comments

Comments
 (0)