flow: add ability for weight-based flow control on multiple jobs
authorDavid, Bar <bardavvid@gmail.com>
Sun, 30 Aug 2020 14:29:24 +0000 (17:29 +0300)
committerDavid, Bar <bardavvid@gmail.com>
Mon, 31 Aug 2020 13:49:03 +0000 (16:49 +0300)
commitd4e74fda98b60dc175b4114492fcc7c21c617ddd
tree151b70eef3134c3fb48046db0f0f68fe4424744d
parent42e26e94c06bbfd23a7dc7e681c32972ef73c79d
flow: add ability for weight-based flow control on multiple jobs

Fixes: #741 - fio how to run mix workload all 4 patterns in one job file

Previously, 'flow' was used to regulate activity between 2 or more jobs with
certain weight.  However, the implementation was ineffective when regulating
more than 2 jobs with different weights, since it relied on a single,
shared counter, and was missing logic to track individual job's activity
and regulate it according to it's requested weight in proportion to other jobs'
requested weight and activity.

This commit modifies the 'flow' functionality to track each job's
activity and the total activity belonging to a 'flow_id' group.
Using this new information, the 'flow' logic is then modified to
regulate a job's activity in proportion to other jobs in the
same group.  Similar to previous behavior, the regulation is done by
stalling a job's activity.

New jobs joining an existing 'flow_id' group or jobs repead from said
group will cause re-calibration of the weights and alter the activity as a
result.  For example, 3 jobs (j1,j2,j3) with weights (1:2:3)
respectively will maintain activity ratio of 1:2:3.  Thus, j1 will have
activity of 1/6, j2 - 2/6 and j3 - 1/2.

If j3 exits prematurely, the proportion is re-calibrated
such that j1 will strive to have activity of 1/3 and j2 - 2/3.

Re-calibration phase may cause a hiccup in the activity of one or more
jobs since the new desired proportion might not be achieved quickly
enough.

Signed-off-by: David, Bar <bardavvid@gmail.com>
16 files changed:
HOWTO
arch/arch.h
cconv.c
examples/butterfly.fio
examples/flow.fio
fio.1
fio.h
flow.c
flow.h
options.c
server.h
t/jobs/t0011-5d2788d5.fio
t/jobs/t0012.fio
t/jobs/t0014.fio [new file with mode: 0644]
t/run-fio-tests.py
thread_options.h