Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/vishvananda/netlink v1.3.1
github.com/vishvananda/netns v0.0.5
golang.org/x/net v0.46.0
golang.org/x/sys v0.37.0
golang.org/x/sys v0.38.0
google.golang.org/protobuf v1.36.10
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
9 changes: 2 additions & 7 deletions internal/linux/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package linux

import (
"os"
"unsafe"

"golang.org/x/sys/unix"
)
Expand Down Expand Up @@ -75,13 +74,9 @@ func Sendmsg(fd int, p, oob []byte, to unix.Sockaddr, flags int) error {
}

// SetMempolicy wraps set_mempolicy.
func SetMempolicy(mode uint, mask *unix.CPUSet) error {
func SetMempolicy(mode int, mask *unix.CPUSet) error {
err := retryOnEINTR(func() error {
_, _, errno := unix.Syscall(unix.SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), unsafe.Sizeof(*mask)*8)
if errno != 0 {
return errno
}
return nil
return unix.SetMemPolicy(mode, mask)
})
return os.NewSyscallError("set_mempolicy", err)
}
Expand Down
4 changes: 2 additions & 2 deletions libcontainer/configs/memorypolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const (
type LinuxMemoryPolicy struct {
// Mode specifies memory policy mode without mode flags. See
// set_mempolicy() documentation for details.
Mode uint `json:"mode,omitempty"`
Mode int `json:"mode,omitempty"`
// Flags contains mode flags.
Flags uint `json:"flags,omitempty"`
Flags int `json:"flags,omitempty"`
// Nodes contains NUMA nodes to which the mode applies.
Nodes *unix.CPUSet `json:"nodes,omitempty"`
}
28 changes: 14 additions & 14 deletions libcontainer/specconv/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ var (
flag int
}
complexFlags map[string]func(*configs.Mount)
mpolModeMap map[string]uint
mpolModeFMap map[string]uint
mpolModeMap map[string]int
mpolModeFMap map[string]int
)

func initMaps() {
Expand Down Expand Up @@ -152,20 +152,20 @@ func initMaps() {
},
}

mpolModeMap = map[string]uint{
string(specs.MpolDefault): configs.MPOL_DEFAULT,
string(specs.MpolPreferred): configs.MPOL_PREFERRED,
string(specs.MpolBind): configs.MPOL_BIND,
string(specs.MpolInterleave): configs.MPOL_INTERLEAVE,
string(specs.MpolLocal): configs.MPOL_LOCAL,
string(specs.MpolPreferredMany): configs.MPOL_PREFERRED_MANY,
string(specs.MpolWeightedInterleave): configs.MPOL_WEIGHTED_INTERLEAVE,
mpolModeMap = map[string]int{
string(specs.MpolDefault): unix.MPOL_DEFAULT,
string(specs.MpolPreferred): unix.MPOL_PREFERRED,
string(specs.MpolBind): unix.MPOL_BIND,
string(specs.MpolInterleave): unix.MPOL_INTERLEAVE,
string(specs.MpolLocal): unix.MPOL_LOCAL,
string(specs.MpolPreferredMany): unix.MPOL_PREFERRED_MANY,
string(specs.MpolWeightedInterleave): unix.MPOL_WEIGHTED_INTERLEAVE,
}

mpolModeFMap = map[string]uint{
string(specs.MpolFStaticNodes): configs.MPOL_F_STATIC_NODES,
string(specs.MpolFRelativeNodes): configs.MPOL_F_RELATIVE_NODES,
string(specs.MpolFNumaBalancing): configs.MPOL_F_NUMA_BALANCING,
mpolModeFMap = map[string]int{
string(specs.MpolFStaticNodes): unix.MPOL_F_STATIC_NODES,
string(specs.MpolFRelativeNodes): unix.MPOL_F_RELATIVE_NODES,
string(specs.MpolFNumaBalancing): unix.MPOL_F_NUMA_BALANCING,
}
})
}
Expand Down
2 changes: 2 additions & 0 deletions vendor/golang.org/x/sys/unix/mkerrors.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/golang.org/x/sys/unix/syscall_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading