All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.william.auld@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Use fault-injection to force the shrinker to run in live GTT tests
Date: Fri, 10 Feb 2017 15:46:52 +0000	[thread overview]
Message-ID: <CAM0jSHPY4MGG=Z2pPQKHBg4zqq8vyR+tBiiopW_rZFswvujADA@mail.gmail.com> (raw)
In-Reply-To: <20170208114038.12835-1-chris@chris-wilson.co.uk>

On 8 February 2017 at 11:40, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> It is possible whilst allocating the page-directory tree for a ppgtt
> bind that the shrinker may run and reap unused parts of the tree. If the
> shrinker happens to remove a chunk of the tree that the
> allocate_va_range has already processed, we may then try to insert into
> the dangling tree. This test uses the fault-injection framework to force
> the shrinker to be invoked before we allocate new pages, i.e. new chunks
> of the PD tree.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=99295
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/Kconfig.debug            |  1 +
>  drivers/gpu/drm/i915/i915_drv.h               |  2 +
>  drivers/gpu/drm/i915/i915_gem_gtt.c           |  6 ++
>  drivers/gpu/drm/i915/i915_selftest.h          |  2 +
>  drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 98 +++++++++++++++++++++++++++
>  5 files changed, 109 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/Kconfig.debug b/drivers/gpu/drm/i915/Kconfig.debug
> index a4d8cfd77c3c..68ff072f8b76 100644
> --- a/drivers/gpu/drm/i915/Kconfig.debug
> +++ b/drivers/gpu/drm/i915/Kconfig.debug
> @@ -65,6 +65,7 @@ config DRM_I915_SELFTEST
>         bool "Enable selftests upon driver load"
>         depends on DRM_I915
>         default n
> +       select FAULT_INJECTION
>         select PRIME_NUMBERS
>         help
>           Choose this option to allow the driver to perform selftests upon
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 56a3de94ecf4..f298da9eaebc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2468,6 +2468,8 @@ struct drm_i915_private {
>                 int     irq;
>         } lpe_audio;
>
> +       I915_SELFTEST_DECLARE(struct fault_attr vm_fault);
> +
>         /*
>          * NOTE: This is the dri1/ums dungeon, don't add stuff here. Your patch
>          * will be rejected. Instead look for a better place.
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 36142d3d99d2..0247b26265dd 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -23,6 +23,9 @@
>   *
>   */
>
> +#include <linux/slab.h> /* fault-inject.h is not standalone! */
What do you mean by not standalone, it doesn't build without this?

> +
> +#include <linux/fault-inject.h>
#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) ?

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-10 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 11:40 [PATCH] drm/i915: Use fault-injection to force the shrinker to run in live GTT tests Chris Wilson
2017-02-10 15:46 ` Matthew Auld [this message]
2017-02-10 16:21   ` Chris Wilson

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='CAM0jSHPY4MGG=Z2pPQKHBg4zqq8vyR+tBiiopW_rZFswvujADA@mail.gmail.com' \
    --to=matthew.william.auld@gmail.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.