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/amd64.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/linux/amd64.go') diff --git a/sys/linux/amd64.go b/sys/linux/amd64.go index b0de98e09..1259cb233 100644 --- a/sys/linux/amd64.go +++ b/sys/linux/amd64.go @@ -18970,7 +18970,12 @@ var syscalls_amd64 = []*Syscall{ {NR: 258, 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: 8}, 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: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}, Val: 511}, + }}, + {NR: 258, Name: "mkdirat$cgroup_root", CallName: "mkdirat", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, 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: 8}}, Val: 511}, }}, {NR: 133, Name: "mknod", CallName: "mknod", Args: []Type{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}}, @@ -19241,7 +19246,7 @@ var syscalls_amd64 = []*Syscall{ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, {NR: 257, Name: "openat$cgroup_root", CallName: "openat", Args: []Type{ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "fd", TypeSize: 8}}, Val: 18446744073709551516}, - &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, 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: 8}, 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: 8}}, Val: 2097154}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "mode", TypeSize: 8}}}, }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd_cgroup", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, @@ -27499,4 +27504,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "19ac00543e4b0f4b0bf07613621b657183a41b86" +const revision_amd64 = "3a0e3a3bc8fc12f4a6ae3ac9a8b06310f37ec343" -- cgit mrf-deployment