Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	"Gwan-gyeong Mun" <gwan-gyeong.mun@intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Stuart Summers" <stuart.summers@intel.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>
Subject: Re: [PATCH] drm/xe: Do not allow scratch page on long running jobs
Date: Thu, 19 Sep 2024 15:52:24 +0000	[thread overview]
Message-ID: <ZuxIuCF+dsxOT253@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240919104704.3591977-1-nirmoy.das@intel.com>

On Thu, Sep 19, 2024 at 12:47:04PM +0200, Nirmoy Das wrote:
> This was agreed upon but not enforced, so enforce the limitation
> of not allowing scratch pages on long-running jobs unless absolutely
> required, which is currently the case for a DG2 SKU.
> 
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>

I think this type of change we will need a maintainer to bless and
likely someone from the compute UMD.

It does LGTM, with that:
Acked-by: Matthew Brost <matthew.brost@intel.com>

> Cc: Stuart Summers <stuart.summers@intel.com>
> Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
> Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_vm.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index a3d7cb7cfd22..92dc55f3479b 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -1711,6 +1711,11 @@ find_ufence_get(struct xe_sync_entry *syncs, u32 num_syncs)
>  	return NULL;
>  }
>  
> +static bool xe_vm_device_requires_scratch_page(struct xe_device *xe)
> +{
> +	return XE_WA(xe_root_mmio_gt(xe), 14016763929);
> +}
> +
>  #define ALL_DRM_XE_VM_CREATE_FLAGS (DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE | \
>  				    DRM_XE_VM_CREATE_FLAG_LR_MODE | \
>  				    DRM_XE_VM_CREATE_FLAG_FAULT_MODE)
> @@ -1730,7 +1735,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
>  	if (XE_IOCTL_DBG(xe, args->extensions))
>  		return -EINVAL;
>  
> -	if (XE_WA(xe_root_mmio_gt(xe), 14016763929))
> +	if (xe_vm_device_requires_scratch_page(xe))
>  		args->flags |= DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE;
>  
>  	if (XE_IOCTL_DBG(xe, args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE &&
> @@ -1747,6 +1752,15 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
>  			 args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
>  		return -EINVAL;
>  
> +	/*
> +	 * Scratch page is disabled for long running job unless absolutely
> +	 * required as this can introduce hidden bugs.
> +	 */
> +	if (!xe_vm_device_requires_scratch_page(xe) &&
> +	    XE_IOCTL_DBG(xe, args->flags & DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE &&
> +			 (args->flags & DRM_XE_VM_CREATE_FLAG_LR_MODE)))
> +		return -EINVAL;
> +
>  	if (XE_IOCTL_DBG(xe, !(args->flags & DRM_XE_VM_CREATE_FLAG_LR_MODE) &&
>  			 args->flags & DRM_XE_VM_CREATE_FLAG_FAULT_MODE))
>  		return -EINVAL;
> -- 
> 2.46.0
> 

  parent reply	other threads:[~2024-09-19 15:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19 10:47 [PATCH] drm/xe: Do not allow scratch page on long running jobs Nirmoy Das
2024-09-19 11:34 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-19 11:35 ` ✓ CI.checkpatch: " Patchwork
2024-09-19 11:36 ` ✓ CI.KUnit: " Patchwork
2024-09-19 12:22 ` ✓ CI.Build: " Patchwork
2024-09-19 12:24 ` ✓ CI.Hooks: " Patchwork
2024-09-19 12:26 ` ✓ CI.checksparse: " Patchwork
2024-09-19 12:58 ` ✓ CI.BAT: " Patchwork
2024-09-19 15:52 ` Matthew Brost [this message]
2024-09-20  9:14   ` [PATCH] " Nirmoy Das
2024-11-06 22:45   ` Lucas De Marchi
2024-09-19 19:27 ` ✗ CI.FULL: 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=ZuxIuCF+dsxOT253@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=stuart.summers@intel.com \
    --cc=thomas.hellstrom@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox