All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Subject: Re: [PATCH] drm/xe/guc_submit: Simplify and fix diff calculation
Date: Wed, 14 May 2025 16:54:41 -0700	[thread overview]
Message-ID: <aCUtQQMooBiBuOSW@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20250513-time-wrap-v1-1-fba9a69a65c8@intel.com>

On Tue, May 13, 2025 at 07:25:49AM -0700, Lucas De Marchi wrote:
> With a u32 type, there's no need to check which one is greater: the
> current is always the latest and if it's less than the previous, it's
> because it wrapped: just do the unsigned calculation that will lead to
> the same result, or better the correct one. It fixes an off-by-one in
> the wrapped calculation, however that doesn't really matter for the
> timeout calculation.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_guc_submit.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index fb125f940de8f..80f748baad3f3 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -976,10 +976,7 @@ static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job)
>  	 */
>  	xe_gt_assert(gt, timeout_ms < 100 * MSEC_PER_SEC);
>  
> -	if (ctx_timestamp < ctx_job_timestamp)
> -		diff = ctx_timestamp + U32_MAX - ctx_job_timestamp;
> -	else
> -		diff = ctx_timestamp - ctx_job_timestamp;
> +	diff = ctx_timestamp - ctx_job_timestamp;
>  
>  	/*
>  	 * Ensure timeout is within 5% to account for an GuC scheduling latency
> 
> 
> 

  parent reply	other threads:[~2025-05-14 23:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 14:25 [PATCH] drm/xe/guc_submit: Simplify and fix diff calculation Lucas De Marchi
2025-05-13 14:59 ` Raag Jadav
2025-05-14 14:32 ` ✓ CI.Patch_applied: success for " Patchwork
2025-05-14 14:32 ` ✓ CI.checkpatch: " Patchwork
2025-05-14 14:33 ` ✓ CI.KUnit: " Patchwork
2025-05-14 14:52 ` ✓ CI.Hooks: " Patchwork
2025-05-14 14:55 ` ✓ CI.Build: " Patchwork
2025-05-14 14:56 ` ✓ CI.checksparse: " Patchwork
2025-05-14 15:26 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-14 20:35 ` ✓ Xe.CI.Full: " Patchwork
2025-05-14 22:29 ` [PATCH] " Umesh Nerlige Ramappa
2025-05-14 23:54 ` Matthew Brost [this message]
2025-05-27  0:29 ` ✗ CI.Patch_applied: failure for " Patchwork

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=aCUtQQMooBiBuOSW@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=umesh.nerlige.ramappa@intel.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.