From bf5e585c5e1b12fe80ee486fdd48eeb71a13fa21 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 27 Mar 2018 11:39:58 +0200 Subject: executor: rework cgroups support Turns out creating a cgroup per test is too expensive. Moreover, it leads to hanged tasks as cgroup destruction is asynchronous and overloads kernel work queues. Create only a single cgroup per proc, but restrict descriptions to mess with that single group, instead test processes create own nested cgroups for messing. --- sys/linux/386.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/linux/386.go') diff --git a/sys/linux/386.go b/sys/linux/386.go index 182ba4074..65a73abb5 100644 --- a/sys/linux/386.go +++ b/sys/linux/386.go @@ -18538,7 +18538,12 @@ var syscalls_386 = []*Syscall{ {NR: 296, Name: "mkdirat$cgroup", CallName: "mkdirat", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "fd", TypeSize: 4}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", TypeSize: 5}, Kind: 2, SubKind: "cgroup_names", Values: []string{"syz0\x00", "syz1\x00"}}}, - &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 4}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}, Val: 511}, + }}, + {NR: 296, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 4}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}, Val: 511}, }}, {NR: 14, Name: "mknod", CallName: "mknod", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, @@ -18759,7 +18764,7 @@ var syscalls_386 = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 295, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 4}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup\x00", "./cgroup.cpu\x00", "./cgroup.net\x00"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 4}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2, SubKind: "cgroup_dirs", Values: []string{"./cgroup/syz0\x00", "./cgroup/syz1\x00", "./cgroup.cpu/syz0\x00", "./cgroup.cpu/syz1\x00", "./cgroup.net/syz0\x00", "./cgroup.net/syz1\x00"}}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 4}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 4}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -26843,4 +26848,4 @@ var consts_386 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_386 = "a824837d8ff4977deb75479a7e24923dea93d43c" +const revision_386 = "08cbb09acf4d3d8e82933c83a64bf3131ab25385" -- cgit mrf-deployment