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: