James Morse ae2328b529 x86/resctrl: Rename and change the units of resctrl_cqm_threshold
resctrl_cqm_threshold is stored in a hardware specific chunk size,
but exposed to user-space as bytes.

This means the filesystem parts of resctrl need to know how the hardware
counts, to convert the user provided byte value to chunks. The interface
between the architecture's resctrl code and the filesystem ought to
treat everything as bytes.

Change the unit of resctrl_cqm_threshold to bytes. resctrl_arch_rmid_read()
still returns its value in chunks, so this needs converting to bytes.
As all the users have been touched, rename the variable to
resctrl_rmid_realloc_threshold, which describes what the value is for.

Neither r->num_rmid nor hw_res->mon_scale are guaranteed to be a power
of 2, so the existing code introduces a rounding error from resctrl's
theoretical fraction of the cache usage. This behaviour is kept as it
ensures the user visible value matches the value read from hardware
when the rmid will be reallocated.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Jamie Iles <quic_jiles@quicinc.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Xin Hao <xhao@linux.alibaba.com>
Tested-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20220902154829.30399-20-james.morse@arm.com
2022-09-23 14:23:41 +02:00
..
2022-03-15 10:32:40 +01:00
2021-11-02 22:22:13 -07:00
2022-02-25 09:36:05 +01:00
2022-04-19 17:14:09 -07:00
2022-08-05 09:41:12 -07:00
2022-07-01 11:11:34 +02:00
2022-06-27 10:34:00 +02:00
2022-04-07 08:27:51 -07:00
2022-08-02 15:21:18 -07:00
2022-06-20 06:22:04 -04:00
2022-03-15 10:32:36 +01:00
2021-12-01 00:06:43 +01:00
2022-04-14 14:09:43 +02:00
2022-05-19 19:30:31 +02:00
2022-08-25 15:54:03 +02:00
2022-04-14 14:09:43 +02:00
2022-02-25 09:36:05 +01:00
2021-10-25 23:02:36 -04:00
2022-04-14 14:09:43 +02:00