[PATCH 2/2] amdgpu: Use 'dev_err_ratelimited()' over 'dev_err()' on vm faults

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/07/2016 02:55 PM, Michel Dänzer wrote:
> On 07/11/16 12:47 PM, Edward O'Callaghan wrote:
>> It can be the case that upon GPU page faults we start trashing
>> the logs, and so let us ratelimit here to avoid that.
>>
>> Signed-off-by: Edward O'Callaghan <funfunctor at folklore1984.net>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 8 ++++----
>>  drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 8 ++++----
>>  drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 8 ++++----
>>  3 files changed, 12 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> index b13c8aa..79af3f2 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> @@ -549,7 +549,7 @@ static void gmc_v6_0_vm_decode_fault(struct amdgpu_device *adev,
>>  	mc_id = REG_GET_FIELD(status, mmVM_CONTEXT1_PROTECTION_FAULT_STATUS,
>>  			      xxMEMORY_CLIENT_ID);
>>  
>> -	dev_err(adev->dev, "VM fault (0x%02x, vmid %d) at page %u, %s from '%s' (0x%08x) (%d)\n",
>> +	dev_err_ratelimited(adev->dev, "VM fault (0x%02x, vmid %d) at page %u, %s from '%s' (0x%08x) (%d)\n",
>>  	       protections, vmid, addr,
>>  	       REG_GET_FIELD(status, mmVM_CONTEXT1_PROTECTION_FAULT_STATUS,
>>  			     xxMEMORY_CLIENT_RW) ?
>> @@ -1007,11 +1007,11 @@ static int gmc_v6_0_process_interrupt(struct amdgpu_device *adev,
>>  	if (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_FIRST)
>>  		gmc_v6_0_set_fault_enable_default(adev, false);
>>  
>> -	dev_err(adev->dev, "GPU fault detected: %d 0x%08x\n",
>> +	dev_err_ratelimited(adev->dev, "GPU fault detected: %d 0x%08x\n",
>>  		entry->src_id, entry->src_data);
>> -	dev_err(adev->dev, "  VM_CONTEXT1_PROTECTION_FAULT_ADDR   0x%08X\n",
>> +	dev_err_ratelimited(adev->dev, "  VM_CONTEXT1_PROTECTION_FAULT_ADDR   0x%08X\n",
>>  		addr);
>> -	dev_err(adev->dev, "  VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
>> +	dev_err_ratelimited(adev->dev, "  VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
>>  		status);
>>  	gmc_v6_0_vm_decode_fault(adev, status, addr, 0);
> 
> If calling dev_err_ratelimited separately for each line means that some
> lines corresponding to a single VM fault may or may not appear depending
> on the rate, it'd be better to use a single call per VM fault.
Ah ok, yes I was not 100% that was definitely the case - easy to fix, I
will resend a update to address it. Thanks, Ed.

> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20161107/0e2d265e/attachment-0001.sig>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux