• Ilpo Järvinen's avatar
    selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test · 205de6dd
    Ilpo Järvinen authored
    CAT test spawns two processes into two different control groups with
    exclusive schemata. Both the processes alloc a buffer from memory
    matching their allocated LLC block size and flush the entire buffer out
    of caches. Since the processes are reading through the buffer only once
    during the measurement and initially all the buffer was flushed, the
    test isn't testing CAT.
    
    Rewrite the CAT test to allocate a buffer sized to half of LLC. Then
    perform a sequence of tests with different LLC alloc sizes starting
    from half of the CBM bits down to 1-bit CBM. Flush the buffer before
    each test and read the buffer twice. Observe the LLC misses on the
    second read through the buffer. As the allocated LLC block gets smaller
    and smaller, the LLC misses will become larger and larger giving a
    strong signal on CAT working properly.
    
    The new CAT test is using only a single process because it relies on
    measured effect against another run of itself rather than another
    process adding noise. The rest of the system is set to use the CBM bits
    not used by the CAT test to keep the test isolated.
    
    Replace count_bits() with count_contiguous_bits() to get the first bit
    position in order to be able to calculate masks based on it.
    
    This change has been tested with a number of systems from different
    generations.
    Suggested-by: default avatarReinette Chatre <reinette.chatre@intel.com>
    Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    205de6dd
fill_buf.c 3.35 KB