diff mbox series

[v5,07/12] cxl: Move QoS class to be calculated from the nearest CPU

Message ID 20240206222951.1833098-8-dave.jiang@intel.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series cxl: Add support to report region access coordinates to numa nodes | expand

Commit Message

Dave Jiang Feb. 6, 2024, 10:28 p.m. UTC
Retrieve the qos_class (QTG ID) using the access coordinates from the
nearest CPU rather than the nearst initiator that may not be a CPU.
This may be the more appropriate number that applications care about.

Link: https://lore.kernel.org/linux-cxl/20240112113023.00006c50@Huawei.com/
Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/cdat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron Feb. 15, 2024, 4:57 p.m. UTC | #1
On Tue, 6 Feb 2024 15:28:35 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> Retrieve the qos_class (QTG ID) using the access coordinates from the
> nearest CPU rather than the nearst initiator that may not be a CPU.
> This may be the more appropriate number that applications care about.
> 
> Link: https://lore.kernel.org/linux-cxl/20240112113023.00006c50@Huawei.com/
> Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Might be worth calling out that in most cases they are the same so
that no one bothers to backport this.

> ---
>  drivers/cxl/core/cdat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c
> index 79844874a34b..bd0ff3cebb8c 100644
> --- a/drivers/cxl/core/cdat.c
> +++ b/drivers/cxl/core/cdat.c
> @@ -198,12 +198,12 @@ static int cxl_port_perf_data_calculate(struct cxl_port *port,
>  		 * coordinates in order to allow calculation of access class
>  		 * 0 and 1 for region later.
>  		 */
> -		cxl_coordinates_combine(&coord[ACCESS_COORDINATE_LOCAL],
> -					&coord[ACCESS_COORDINATE_LOCAL],
> +		cxl_coordinates_combine(&coord[ACCESS_COORDINATE_CPU],
> +					&coord[ACCESS_COORDINATE_CPU],
>  					&dent->coord);
>  		dent->entries = 1;
>  		rc = cxl_root->ops->qos_class(cxl_root,
> -					      &coord[ACCESS_COORDINATE_LOCAL],
> +					      &coord[ACCESS_COORDINATE_CPU],
>  					      1, &qos_class);
>  		if (rc != 1)
>  			continue;
diff mbox series

Patch

diff --git a/drivers/cxl/core/cdat.c b/drivers/cxl/core/cdat.c
index 79844874a34b..bd0ff3cebb8c 100644
--- a/drivers/cxl/core/cdat.c
+++ b/drivers/cxl/core/cdat.c
@@ -198,12 +198,12 @@  static int cxl_port_perf_data_calculate(struct cxl_port *port,
 		 * coordinates in order to allow calculation of access class
 		 * 0 and 1 for region later.
 		 */
-		cxl_coordinates_combine(&coord[ACCESS_COORDINATE_LOCAL],
-					&coord[ACCESS_COORDINATE_LOCAL],
+		cxl_coordinates_combine(&coord[ACCESS_COORDINATE_CPU],
+					&coord[ACCESS_COORDINATE_CPU],
 					&dent->coord);
 		dent->entries = 1;
 		rc = cxl_root->ops->qos_class(cxl_root,
-					      &coord[ACCESS_COORDINATE_LOCAL],
+					      &coord[ACCESS_COORDINATE_CPU],
 					      1, &qos_class);
 		if (rc != 1)
 			continue;