block: Switch from BFQ-v5 for 3.1.0 to BFQ-v5r1 for 3.1.0.

Improvements:

- BUG FIX: Fixed stall occurring when the active queue is moved to
  a different group while idling (this caused the idling timer to be
  cancelled and hence no new queue to be selected, and no new
  request to be dispatched).
- BUG FIX: Fixed wrong assignment of too high budgets to queues during
  the first few seconds after initialization.
- BUG FIX: Added proper locking to the function handling the "weights"
  tunable.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Mauro Andreolini <mauro.andreolini@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
block: Switch from BFQ-v5r1 for 3.1.0 to BFQ-v6 for 3.1.0.

Improvements:

- Replacement of the cooperating-queue merging mechanism borrowed from
  CFQ with Early Queue Merge (EQM), a unified mechanism to get a
  sequential read pattern, and hence a high throughput with any set of
  processes performing interleaved I/O.
  The  main idea  is checking newly arrived requests against the next
  request of the active queue both in case of actual request insert and
  in case of request merge. EQM  also preserves the typical low-latency
  properties of  BFQ, by properly restoring the weight-raising state of
  a queue when it gets back to a non-merged state (see
  http://algo.ing.unimo.it/people/paolo/disk_sched/description.php for
  more details). The code for detecting whether two queues have to be
  merged is a slightly modified version of the CFQ code for detecting
  whether two queues belong to cooperating processes and whether the
  service of a queue should be preempted to boost the throughput.
- Fix a bug that caused the peak rate of a disk to be computed as zero
  in case of multiple I/O errors. Subsequent estimations of the weight
  raising duration caused a division-by-zero error.

Signed-off-by: Mauro Andreolini <mauro.andreolini@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Reviewed-by: Paolo Valente <paolo.valente@unimore.it>
block: Switch from BFQ-v6 for 3.1.0 to BFQ-v6r1 for 3.1.0.

Improvements:
- Introduce an eqm_lock to protect EQM-related data.
- Fix use-after-free of queues in __bfq_bfqq_expire(). It may happen that
  a call to bfq_del_bfqq_busy() puts the last reference taken on a queue
  and frees it. Subsequent accesses to that same queue would result in a
  use-after-free. Make sure that a queue that has just been deleted from
  busy is no more touched.
- Use the uninitialized_var() macro when needed. It may happen that a
  variable is initialized in a function that is called by the function
  that defined it. Use the uninitialized_var() macro in these cases.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
block: Switch from BFQ-v6r1 for 3.1.0 to BFQ-v6r2 for 3.1.0.

Improvements:

- Fairness fix: the case of queue expiration for budget timeout is
  now correctly handled also for sync queues, thus allowing also
  the processes corresponding to these queues to be guaranteed their
  reserved share of the disk throughput.
- Fixed a bug that prevented group weights from being correctly
  set via the sysfs interface.
- Fixed a bug that cleared a previously-set group weight if the
  same value was re-inserted via the sysfs interface.
- Fixed an EQM bug that allowed a newly-started process to skip
  its initial weight-raising period if its queue was merged before
  its first request was inserted.
- Fixed a bug that preserved already-started weight-raising periods
  even if the low_latency tunable was disabled.
- The raising_max_time tunable now shows, more user-friendly, the
  maximum raising time in milliseconds.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>