[PATCH] drm/amdkfd: ratelimited override pte flags messages

Philip Yang Philip.Yang at amd.com
Thu Sep 28 22:22:12 UTC 2023


Use ratelimited version of dev_dbg to avoid flooding dmesg log. No
functional change.

Signed-off-by: Philip Yang <Philip.Yang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c     | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
index 96d601e209b8..6d2878684287 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
@@ -848,7 +848,7 @@ static void amdgpu_vm_pte_update_flags(struct amdgpu_vm_update_params *params,
 			amdgpu_gmc_override_vm_pte_flags(adev, params->vm,
 							 addr, &flags);
 		else
-			dev_dbg(adev->dev,
+			dev_dbg_ratelimited(adev->dev,
 				"override_vm_pte_flags skipped: non-contiguous\n");
 	}
 
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 6b15677c0314..ad0d63472e17 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -1244,7 +1244,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
 	 * the DMA address.
 	 */
 	if (!adev->ram_is_direct_mapped) {
-		dev_dbg(adev->dev, "RAM is not direct mapped\n");
+		dev_dbg_ratelimited(adev->dev, "RAM is not direct mapped\n");
 		return;
 	}
 
@@ -1253,7 +1253,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
 	 */
 	if ((*flags & AMDGPU_PTE_MTYPE_VG10_MASK) !=
 	    AMDGPU_PTE_MTYPE_VG10(MTYPE_NC)) {
-		dev_dbg(adev->dev, "MTYPE is not NC\n");
+		dev_dbg_ratelimited(adev->dev, "MTYPE is not NC\n");
 		return;
 	}
 
@@ -1264,7 +1264,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
 	if (adev->gmc.is_app_apu && vm->mem_id >= 0) {
 		local_node = adev->gmc.mem_partitions[vm->mem_id].numa.node;
 	} else {
-		dev_dbg(adev->dev, "Only native mode APU is supported.\n");
+		dev_dbg_ratelimited(adev->dev, "Only native mode APU is supported.\n");
 		return;
 	}
 
@@ -1272,12 +1272,12 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
 	 * page or NUMA nodes.
 	 */
 	if (!page_is_ram(addr >> PAGE_SHIFT)) {
-		dev_dbg(adev->dev, "Page is not RAM.\n");
+		dev_dbg_ratelimited(adev->dev, "Page is not RAM.\n");
 		return;
 	}
 	nid = pfn_to_nid(addr >> PAGE_SHIFT);
-	dev_dbg(adev->dev, "vm->mem_id=%d, local_node=%d, nid=%d\n",
-		vm->mem_id, local_node, nid);
+	dev_dbg_ratelimited(adev->dev, "vm->mem_id=%d, local_node=%d, nid=%d\n",
+			    vm->mem_id, local_node, nid);
 	if (nid == local_node) {
 		uint64_t old_flags = *flags;
 		unsigned int mtype_local = MTYPE_RW;
@@ -1289,8 +1289,8 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
 
 		*flags = (*flags & ~AMDGPU_PTE_MTYPE_VG10_MASK) |
 			 AMDGPU_PTE_MTYPE_VG10(mtype_local);
-		dev_dbg(adev->dev, "flags updated from %llx to %llx\n",
-			old_flags, *flags);
+		dev_dbg_ratelimited(adev->dev, "flags updated from %llx to %llx\n",
+				    old_flags, *flags);
 	}
 }
 
-- 
2.35.1



More information about the amd-gfx mailing list