From: Jani Nikula <jani.nikula@linux.intel.com>
To: Eric Blau <eblau@eblau.com>, stable@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org,
Daniel Vetter <daniel.vetter@intel.com>,
Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH] drm/i915: Do not drop pagetables when empty
Date: Thu, 15 Jun 2017 08:51:34 +0300 [thread overview]
Message-ID: <87a859ztll.fsf@intel.com> (raw)
In-Reply-To: <20170614170728.GA30101@eric-macbookpro.localdomain>
On Wed, 14 Jun 2017, Eric Blau <eblau@eblau.com> wrote:
> Can the following patch please be included in the next stable release?
> It looks like it was submitted previously by Daniel Vetter, but has not
> been included in 4.11.y yet. Thanks.
The previous submission would be [1]. Please reference that instead of
resending patches with incomplete upstream references. Thank you.
BR,
Jani.
[1] http://mid.mail-archive.com/20170526082906.8982-1-daniel.vetter@ffwll.ch
> From 64b1d89f358df34701d92471b65f99f4eff1b384 Mon Sep 17 00:00:00 2001
> From: Chris Wilson <chris@chris-wilson.co.uk>
> Date: Thu, 18 May 2017 11:00:15 +0100
> Subject: [PATCH] drm/i915: Do not drop pagetables when empty
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Due to a race with the shrinker, when we try to allocate a pagetable, we
> may end up shrinking it instead. This comes as a nasty surprise as we
> try to dereference it to fill in the pagetable entries for the object.
>
> In linus/master this is fixed by pinning the pagetables prior to
> allocation, but that backport is roughly
> drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
> drivers/gpu/drm/i915/i915_gem_evict.c | 12 +-
> drivers/gpu/drm/i915/i915_gem_gtt.c | 2017 ++++++++++++++-------------------
> drivers/gpu/drm/i915/i915_gem_gtt.h | 123 +-
> drivers/gpu/drm/i915/i915_trace.h | 104 --
> drivers/gpu/drm/i915/i915_vgpu.c | 9 +-
> drivers/gpu/drm/i915/i915_vma.c | 9 -
> drivers/gpu/drm/i915/intel_lrc.c | 4 +-
> 8 files changed, 946 insertions(+), 1334 deletions(-)
> i.e. unsuitable for stable. Instead we neuter the code that tried to
> free the pagetables.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99295
> Fixes: 2ce5179fe826 ("drm/i915/gtt: Free unused lower-level page tables")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michel Thierry <michel.thierry@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v4.10+
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 96e45a4d5441..4f581adf2fcf 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -755,10 +755,6 @@ static bool gen8_ppgtt_clear_pt(struct i915_address_space *vm,
> GEM_BUG_ON(pte_end > GEN8_PTES);
>
> bitmap_clear(pt->used_ptes, pte, num_entries);
> - if (USES_FULL_PPGTT(vm->i915)) {
> - if (bitmap_empty(pt->used_ptes, GEN8_PTES))
> - return true;
> - }
>
> pt_vaddr = kmap_px(pt);
>
> @@ -798,9 +794,6 @@ static bool gen8_ppgtt_clear_pd(struct i915_address_space *vm,
> }
> }
>
> - if (bitmap_empty(pd->used_pdes, I915_PDES))
> - return true;
> -
> return false;
> }
>
> @@ -829,9 +822,6 @@ static bool gen8_ppgtt_clear_pdp(struct i915_address_space *vm,
>
> mark_tlbs_dirty(ppgtt);
>
> - if (bitmap_empty(pdp->used_pdpes, I915_PDPES_PER_PDP(dev_priv)))
> - return true;
> -
> return false;
> }
>
>
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Eric Blau <eblau@eblau.com>, stable@vger.kernel.org
Cc: "Chris Wilson" <chris@chris-wilson.co.uk>,
"Michel Thierry" <michel.thierry@intel.com>,
"Mika Kuoppala" <mika.kuoppala@intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Michał Winiarski" <michal.winiarski@intel.com>,
"Daniel Vetter" <daniel.vetter@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Do not drop pagetables when empty
Date: Thu, 15 Jun 2017 08:51:34 +0300 [thread overview]
Message-ID: <87a859ztll.fsf@intel.com> (raw)
In-Reply-To: <20170614170728.GA30101@eric-macbookpro.localdomain>
On Wed, 14 Jun 2017, Eric Blau <eblau@eblau.com> wrote:
> Can the following patch please be included in the next stable release?
> It looks like it was submitted previously by Daniel Vetter, but has not
> been included in 4.11.y yet. Thanks.
The previous submission would be [1]. Please reference that instead of
resending patches with incomplete upstream references. Thank you.
BR,
Jani.
[1] http://mid.mail-archive.com/20170526082906.8982-1-daniel.vetter@ffwll.ch
> From 64b1d89f358df34701d92471b65f99f4eff1b384 Mon Sep 17 00:00:00 2001
> From: Chris Wilson <chris@chris-wilson.co.uk>
> Date: Thu, 18 May 2017 11:00:15 +0100
> Subject: [PATCH] drm/i915: Do not drop pagetables when empty
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> Due to a race with the shrinker, when we try to allocate a pagetable, we
> may end up shrinking it instead. This comes as a nasty surprise as we
> try to dereference it to fill in the pagetable entries for the object.
>
> In linus/master this is fixed by pinning the pagetables prior to
> allocation, but that backport is roughly
> drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
> drivers/gpu/drm/i915/i915_gem_evict.c | 12 +-
> drivers/gpu/drm/i915/i915_gem_gtt.c | 2017 ++++++++++++++-------------------
> drivers/gpu/drm/i915/i915_gem_gtt.h | 123 +-
> drivers/gpu/drm/i915/i915_trace.h | 104 --
> drivers/gpu/drm/i915/i915_vgpu.c | 9 +-
> drivers/gpu/drm/i915/i915_vma.c | 9 -
> drivers/gpu/drm/i915/intel_lrc.c | 4 +-
> 8 files changed, 946 insertions(+), 1334 deletions(-)
> i.e. unsuitable for stable. Instead we neuter the code that tried to
> free the pagetables.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99295
> Fixes: 2ce5179fe826 ("drm/i915/gtt: Free unused lower-level page tables")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michel Thierry <michel.thierry@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v4.10+
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 96e45a4d5441..4f581adf2fcf 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -755,10 +755,6 @@ static bool gen8_ppgtt_clear_pt(struct i915_address_space *vm,
> GEM_BUG_ON(pte_end > GEN8_PTES);
>
> bitmap_clear(pt->used_ptes, pte, num_entries);
> - if (USES_FULL_PPGTT(vm->i915)) {
> - if (bitmap_empty(pt->used_ptes, GEN8_PTES))
> - return true;
> - }
>
> pt_vaddr = kmap_px(pt);
>
> @@ -798,9 +794,6 @@ static bool gen8_ppgtt_clear_pd(struct i915_address_space *vm,
> }
> }
>
> - if (bitmap_empty(pd->used_pdes, I915_PDES))
> - return true;
> -
> return false;
> }
>
> @@ -829,9 +822,6 @@ static bool gen8_ppgtt_clear_pdp(struct i915_address_space *vm,
>
> mark_tlbs_dirty(ppgtt);
>
> - if (bitmap_empty(pdp->used_pdpes, I915_PDPES_PER_PDP(dev_priv)))
> - return true;
> -
> return false;
> }
>
>
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2017-06-15 5:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 17:07 [Intel-gfx] [PATCH] drm/i915: Do not drop pagetables when empty Eric Blau
2017-06-15 5:51 ` Jani Nikula [this message]
2017-06-15 5:51 ` Jani Nikula
2017-06-15 6:31 ` Greg KH
2017-06-15 6:55 ` Jani Nikula
2017-06-15 7:12 ` Greg KH
2017-06-15 7:12 ` [Intel-gfx] " Greg KH
2017-06-15 7:40 ` Jani Nikula
2017-06-15 7:40 ` [Intel-gfx] " Jani Nikula
-- strict thread matches above, loose matches on Subject: below --
2017-05-26 8:29 Daniel Vetter
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=87a859ztll.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=daniel.vetter@intel.com \
--cc=eblau@eblau.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kuoppala@intel.com \
--cc=stable@vger.kernel.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.