mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
cxl/port: Convert PCIe link latency to nanoseconds
Commit51293c565c("cxl: Fix incorrect region perf data calculation") converted CDAT latencies to nanoseconds and removed the conversion in cxl_region_perf_data_calculate(), but left PCIe link latencies in picoseconds. This inflates the FlitLatency contribution to region and node latencies by a factor of 1000, exposing incorrect values in sysfs. The resulting abstract distances can incorrectly reverse the memory tier ordering of nodes. Convert the FlitLatency contribution to nanoseconds before adding it to the access coordinates, rounding up as cdat_normalize() does. Fixes:51293c565c("cxl: Fix incorrect region perf data calculation") Cc: stable@vger.kernel.org Signed-off-by: Koichiro Den <den@valinux.co.jp> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20261009045452.1107921-2-den@valinux.co.jp Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
parent
b5d14009bd
commit
16440d6e4b
|
|
@ -2392,6 +2392,9 @@ EXPORT_SYMBOL_NS_GPL(schedule_cxl_memdev_detach, "CXL");
|
|||
|
||||
static void add_latency(struct access_coordinate *c, long latency)
|
||||
{
|
||||
/* Convert link latency from picoseconds to nanoseconds. */
|
||||
latency = DIV_ROUND_UP(latency, 1000);
|
||||
|
||||
for (int i = 0; i < ACCESS_COORDINATE_MAX; i++) {
|
||||
c[i].write_latency += latency;
|
||||
c[i].read_latency += latency;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user