All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben.tuikov@amd.com>
To: Kent Russell <kent.russell@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Mukul Joshi <Mukul.Joshi@amd.com>
Subject: Re: [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold
Date: Thu, 21 Oct 2021 12:44:54 -0400	[thread overview]
Message-ID: <df069bd3-76cd-4662-b4c3-23e6e17c77d6@amd.com> (raw)
In-Reply-To: <50f764cb-64f1-5b36-7e14-1c560784b7ea@amd.com>

On 2021-10-21 12:35, Luben Tuikov wrote:
> On 2021-10-21 11:57, Kent Russell wrote:
>> dmesg doesn't warn when the number of bad pages approaches the
>> threshold for page retirement. WARN when the number of bad pages
>> is at 90% or greater for easier checks and planning, instead of waiting
>> until the GPU is full of bad pages.
>>
>> Cc: Luben Tuikov <luben.tuikov@amd.com>
>> Cc: Mukul Joshi <Mukul.Joshi@amd.com>
>> Signed-off-by: Kent Russell <kent.russell@amd.com>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
>> index f4c05ff4b26c..ce5089216474 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
>> @@ -1077,6 +1077,12 @@ int amdgpu_ras_eeprom_init(struct amdgpu_ras_eeprom_control *control,
>>  		if (res)
>>  			DRM_ERROR("RAS table incorrect checksum or error:%d\n",
>>  				  res);
>> +
>> +		/* Warn if we are at 90% of the threshold or above */
> The kernel uses a couple of styles, this is one of them:
>
> /* Warn ...
>  */
> if (...)
>
> Please use this style as it is used extensively in the amdgpu_ras_eeprom.c file.
>
>> +		if ((10 * control->ras_num_recs) >= (ras->bad_page_cnt_threshold * 9))
> You don't need the extra parenthesis around multiplication--it has higher precedence than relational operators--drop the extra parenthesis.
>
> Regards,
> Luben
>
>> +			DRM_WARN("RAS records:%u exceeds 90%% of threshold:%d",
>> +					control->ras_num_recs,
>> +					ras->bad_page_cnt_threshold);

One more note: The code uses "dev_err()" for this very similar message:

            dev_err(adev->dev,
                "RAS records:%d exceed threshold:%d, "
                "GPU will not be initialized. Replace this GPU or increase the threshold",
                control->ras_num_recs, ras->bad_page_cnt_threshold);

Since your message is essentially the same, sans the "90% of threshold", perhaps you want to use dev_warn(), instead of "DRM_WARN()".

Regards,
Luben

>>  	} else if (hdr->header == RAS_TABLE_HDR_BAD &&
>>  		   amdgpu_bad_page_threshold != 0) {
>>  		res = __verify_ras_table_checksum(control);


  reply	other threads:[~2021-10-21 16:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 15:57 [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold Kent Russell
2021-10-21 15:57 ` [PATCH 2/2] drm/amdgpu: Add kernel parameter support for ignoring bad page threshold Kent Russell
2021-10-21 16:21   ` Luben Tuikov
2021-10-21 16:42     ` Russell, Kent
2021-10-21 16:46       ` Luben Tuikov
2021-10-21 16:49         ` Russell, Kent
2021-10-21 16:55           ` Luben Tuikov
2021-10-21 16:31 ` [PATCH 1/2] drm/amdgpu: Warn when bad pages approaches 90% threshold Lazar, Lijo
2021-10-21 16:35   ` Russell, Kent
2021-10-21 16:35 ` Luben Tuikov
2021-10-21 16:44   ` Luben Tuikov [this message]
2021-10-21 16:47     ` Russell, Kent
2021-10-21 16:49       ` Luben Tuikov
2021-10-21 17:18   ` Felix Kuehling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df069bd3-76cd-4662-b4c3-23e6e17c77d6@amd.com \
    --to=luben.tuikov@amd.com \
    --cc=Mukul.Joshi@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=kent.russell@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.