From e726bdf922950225c79fc81b54b73ea8ecda7921 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 26 Jun 2018 13:59:47 +0200 Subject: syz-manager: make rpc communication finer grained RPC package does excessive caching per connection, so if a larger object is ever sent in any direction, rpc connection consumes large amount of memory persistently. This makes manager consume gigs of memory with large number of VMs and larger corpus/coverage. Make all communication done in very limited batches. --- pkg/rpctype/rpctype.go | 4 ---- pkg/signal/signal.go | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) (limited to 'pkg') diff --git a/pkg/rpctype/rpctype.go b/pkg/rpctype/rpctype.go index f5835914e..ead685c02 100644 --- a/pkg/rpctype/rpctype.go +++ b/pkg/rpctype/rpctype.go @@ -28,10 +28,6 @@ type ConnectArgs struct { } type ConnectRes struct { - Prios [][]float32 - Inputs []RPCInput - MaxSignal signal.Serial - Candidates []RPCCandidate EnabledCalls []int GitRevision string TargetRevision string diff --git a/pkg/signal/signal.go b/pkg/signal/signal.go index e82255537..20deba46a 100644 --- a/pkg/signal/signal.go +++ b/pkg/signal/signal.go @@ -28,6 +28,33 @@ func (s Signal) Empty() bool { return len(s) == 0 } +func (s Signal) Copy() Signal { + c := make(Signal, len(s)) + for e, p := range s { + c[e] = p + } + return c +} + +func (s *Signal) Split(n int) Signal { + if s.Empty() { + return nil + } + c := make(Signal, n) + for e, p := range *s { + delete(*s, e) + c[e] = p + n-- + if n == 0 { + break + } + } + if len(*s) == 0 { + *s = nil + } + return c +} + func FromRaw(raw []uint32, prio uint8) Signal { if len(raw) == 0 { return nil -- cgit mrf-deployment