mem-cache: Creation of dueling classes

Table policies (i.e., replacement, compression, etc) behave
differently depending on the workload, and it is often desired
to be able to selectively switch between them. In this case
the relevant metadata for all the policies must be added to
all of the entries being analyzed.

In order to avoid having to monitor all table entries, a few
of these entries are selected to be sampled and estimate
overall behavior. These sampled entries belong each to a
single policy. Then, based on the predominance of these
samples, the winning policy is applied to the other sets
(followers).

As of now, in order to avoid having to iterate over a vector,
there is a limited number of dueling instances, but it may be
easily extended, if needed.

Based on Set Dueling, proposed in "Adaptive Insertion Policies
for High Performance Caching".

Change-Id: I692a3e5e0ad98581d68167ad7e6b45ab2f4c7b10
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37895
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
4 files changed