1
0
Fork 0
alistair23-linux/arch/x86/kernel/cpu/resctrl
Babu Moger 215e562251 x86/resctrl: Fix memory bandwidth counter width for AMD
commit 2c18bd525c upstream.

Memory bandwidth is calculated reading the monitoring counter
at two intervals and calculating the delta. It is the software’s
responsibility to read the count often enough to avoid having
the count roll over _twice_ between reads.

The current code hardcodes the bandwidth monitoring counter's width
to 24 bits for AMD. This is due to default base counter width which
is 24. Currently, AMD does not implement the CPUID 0xF.[ECX=1]:EAX
to adjust the counter width. But, the AMD hardware supports much
wider bandwidth counter with the default width of 44 bits.

Kernel reads these monitoring counters every 1 second and adjusts the
counter value for overflow. With 24 bits and scale value of 64 for AMD,
it can only measure up to 1GB/s without overflowing. For the rates
above 1GB/s this will fail to measure the bandwidth.

Fix the issue setting the default width to 44 bits by adjusting the
offset.

AMD future products will implement CPUID 0xF.[ECX=1]:EAX.

 [ bp: Let the line stick out and drop {}-brackets around a single
   statement. ]

Fixes: 4d05bf71f1 ("x86/resctrl: Introduce AMD QOS feature")
Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/159129975546.62538.5656031125604254041.stgit@naples-babu.amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-09 09:37:57 +02:00
..
Makefile x86/resctrl: Avoid confusion over the new X86_RESCTRL config 2019-02-02 10:34:52 +01:00
core.c x86/resctrl: Fix memory bandwidth counter width for AMD 2020-07-09 09:37:57 +02:00
ctrlmondata.c x86/resctrl: Prevent NULL pointer dereference when reading mondata 2019-11-03 17:51:22 +01:00
internal.h x86/resctrl: Fix memory bandwidth counter width for AMD 2020-07-09 09:37:57 +02:00
monitor.c x86/resctrl: Fix memory bandwidth counter width for AMD 2020-07-09 09:37:57 +02:00
pseudo_lock.c Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-08 17:25:53 -07:00
pseudo_lock_event.h x86/resctrl: Rename and move rdt files to a separate directory 2018-11-22 20:16:18 +01:00
rdtgroup.c x86/resctrl: Fix a NULL vs IS_ERR() static checker warning in rdt_cdp_peer_get() 2020-06-30 15:36:56 -04:00