From 2fa06225add0fb4c40f00a6ea2a5b495cc209ced Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 3 Jun 2019 13:12:44 +0200 Subject: syz-manager: increase initial poll batch size When the fuzzer starts, it pumps the whole corpus. If we do it using the final batchSize, it can be very slow batch of size 6 can take more than 10 mins for 50K corpus and slow kernel). Use a batch of 30 initially. --- syz-manager/rpc.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/syz-manager/rpc.go b/syz-manager/rpc.go index ed7a78112..e4875c20f 100644 --- a/syz-manager/rpc.go +++ b/syz-manager/rpc.go @@ -159,7 +159,16 @@ func (serv *RPCServer) Poll(a *rpctype.PollArgs, r *rpctype.PollRes) error { r.Candidates = serv.mgr.candidateBatch(serv.batchSize) } if len(r.Candidates) == 0 { - for i := 0; i < serv.batchSize && len(f.inputs) > 0; i++ { + batchSize := serv.batchSize + // When the fuzzer starts, it pumps the whole corpus. + // If we do it using the final batchSize, it can be very slow + // (batch of size 6 can take more than 10 mins for 50K corpus and slow kernel). + // So use a larger batch initially (we use no stats as approximation of initial pump). + const initialBatch = 30 + if len(a.Stats) == 0 && batchSize < initialBatch { + batchSize = initialBatch + } + for i := 0; i < batchSize && len(f.inputs) > 0; i++ { last := len(f.inputs) - 1 r.NewInputs = append(r.NewInputs, f.inputs[last]) f.inputs[last] = rpctype.RPCInput{} -- cgit mrf-deployment