aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-06-26 13:59:47 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-06-26 13:59:47 +0200
commite726bdf922950225c79fc81b54b73ea8ecda7921 (patch)
treeeeba6e9173130719efd9a37888aa7787b0237fbd /pkg
parent826b5aabc4b92d8e584b1ca47ad3b8fdc4a4d5ce (diff)
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.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/rpctype/rpctype.go4
-rw-r--r--pkg/signal/signal.go27
2 files changed, 27 insertions, 4 deletions
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