Skip to contentSkip to conversation

drm/amdkfd: Fix L2 cache size reporting in GFX9.4.3

PATCH Superseded Kent Russell 3 participants 3 messages Feb 6, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Fix L2 cache size reporting in GFX9.4.3

Its currently incorrectly multiplied by number of XCCs in the partition

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -3
index 3df2a8ad86fb..64bf2a56f010 100644
@@ -1640,9 +1640,7 @@ static int fill_in_l2_l3_pcache(struct kfd_cache_properties **props_ext,
 		else
 			mode = UNKNOWN_MEMORY_PARTITION_MODE;
 
-		if (pcache->cache_level == 2)
-			pcache->cache_size = pcache_info[cache_type].cache_size * num_xcc;
-		else if (mode)
+		if (mode)
 			pcache->cache_size = pcache_info[cache_type].cache_size / mode;
 		else
 			pcache->cache_size = pcache_info[cache_type].cache_size;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

The commit description needs a Fixes tag of the offending commit. With that fixed, this patch is:

Quoted 37 lines

-----Original Message-----
From: Russell, Kent <[email protected]>
Sent: Tuesday, February 6, 2024 1:06 PM
To: [email protected]
Cc: Joshi, Mukul <[email protected]>; Russell, Kent <[email protected]>
Subject: [PATCH] drm/amdkfd: Fix L2 cache size reporting in GFX9.4.3

Its currently incorrectly multiplied by number of XCCs in the partition

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -3
index 3df2a8ad86fb..64bf2a56f010 100644
@@ -1640,9 +1640,7 @@ static int fill_in_l2_l3_pcache(struct
 kfd_cache_properties **props_ext,
              else
                      mode = UNKNOWN_MEMORY_PARTITION_MODE;
 
-             if (pcache->cache_level == 2)
-                     pcache->cache_size =
 pcache_info[cache_type].cache_size * num_xcc;
-             else if (mode)
+             if (mode)
                      pcache->cache_size =
pcache_info[cache_type].cache_size / mode;
              else
                      pcache->cache_size =

pcache_info[cache_type].cache_size;
--
2.34.1

Reviewed-by Mukul Joshi
#2 lore raw

[AMD Official Use Only - General]

Comments inline.

Regards,
Ramesh

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Joshi, Mukul
Sent: Wednesday, February 7, 2024 1:36 AM
To: Russell, Kent <[email protected]>; [email protected]
Subject: RE: [PATCH] drm/amdkfd: Fix L2 cache size reporting in GFX9.4.3

[AMD Official Use Only - General]

[AMD Official Use Only - General]

The commit description needs a Fixes tag of the offending commit. With that fixed, this patch is:

Quoted 35 lines

-----Original Message-----
From: Russell, Kent <[email protected]>
Sent: Tuesday, February 6, 2024 1:06 PM
To: [email protected]
Cc: Joshi, Mukul <[email protected]>; Russell, Kent <[email protected]>
Subject: [PATCH] drm/amdkfd: Fix L2 cache size reporting in GFX9.4.3

Its currently incorrectly multiplied by number of XCCs in the partition

---
 drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 -3
index 3df2a8ad86fb..64bf2a56f010 100644
@@ -1640,9 +1640,7 @@ static int fill_in_l2_l3_pcache(struct
 kfd_cache_properties **props_ext,
              else
                      mode = UNKNOWN_MEMORY_PARTITION_MODE;
 
-             if (pcache->cache_level == 2)
-                     pcache->cache_size =
 pcache_info[cache_type].cache_size * num_xcc;
-             else if (mode)
+             if (mode)
                      pcache->cache_size =
pcache_info[cache_type].cache_size / mode;
              else
                      pcache->cache_size =
Quoted 1 line

pcache_info[cache_type].cache_size;

Ramesh: Per my reading a cache_size is correct and should be around 4 MiB. Per my thinking "mode" does not come into play?

Quoted 2 lines

--
2.34.1