public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915/ttm: only fault WILLNEED objects
Date: Wed, 05 Jan 2022 16:09:36 +0100	[thread overview]
Message-ID: <f67ddfc050c94d530040d999878320ab1d60c9ff.camel@linux.intel.com> (raw)
In-Reply-To: <20220105145835.142950-2-matthew.auld@intel.com>

On Wed, 2022-01-05 at 14:58 +0000, Matthew Auld wrote:
> Don't attempt to fault and re-populate purged objects. By some fluke
> this passes the dontneed-after-mmap IGT, but for the wrong reasons.
> 
> Fixes: cf3e3e86d779 ("drm/i915: Use ttm mmap handling for ttm bo's.")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index 923cc7ad8d70..8d61d4538a64 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -883,6 +883,11 @@ static vm_fault_t vm_fault_ttm(struct vm_fault
> *vmf)
>         if (ret)
>                 return ret;
>  
> +       if (obj->mm.madv != I915_MADV_WILLNEED) {
> +               dma_resv_unlock(bo->base.resv);
> +               return VM_FAULT_SIGBUS;
> +       }
> +
>         if (drm_dev_enter(dev, &idx)) {
>                 ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma-
> >vm_page_prot,
>                                               
> TTM_BO_VM_NUM_PREFAULT);



  reply	other threads:[~2022-01-05 15:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 14:58 [Intel-gfx] [PATCH 1/4] drm/i915: don't call free_mmap_offset when purging Matthew Auld
2022-01-05 14:58 ` [Intel-gfx] [PATCH 2/4] drm/i915/ttm: only fault WILLNEED objects Matthew Auld
2022-01-05 15:09   ` Thomas Hellström [this message]
2022-01-05 14:58 ` [Intel-gfx] [PATCH 3/4] drm/i915/ttm: ensure we unmap when purging Matthew Auld
2022-01-05 15:28   ` Thomas Hellström
2022-01-05 14:58 ` [Intel-gfx] [PATCH 4/4] drm/i915/ttm: ensure we unmap when shrinking Matthew Auld
2022-01-05 15:46 ` [Intel-gfx] [PATCH 1/4] drm/i915: don't call free_mmap_offset when purging Thomas Hellström
2022-01-05 16:03   ` Matthew Auld
2022-01-05 16:06     ` Thomas Hellström
2022-01-05 16:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] " Patchwork
2022-01-05 16:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-01-05 18:27 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=f67ddfc050c94d530040d999878320ab1d60c9ff.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@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