All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Do not drop pagetables when empty
@ 2017-05-26  8:29 Daniel Vetter
  2017-06-15  6:43   ` gregkh
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2017-05-26  8:29 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: # v4 . 10+, Daniel Vetter, Mika Kuoppala

From: Chris Wilson <chris@chris-wilson.co.uk>

This is the minimal backport for stable of the upstream commit:

commit dd19674bacba227ae5d3ce680cbc5668198894dc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Feb 15 08:43:46 2017 +0000

    drm/i915: Remove bitmap tracking for used-ptes

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+
Tested-by: Maël Lavault <mael.lavault@protonmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 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;
 }
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Patch "drm/i915: Do not drop pagetables when empty" has been added to the 4.11-stable tree
  2017-05-26  8:29 [PATCH] drm/i915: Do not drop pagetables when empty Daniel Vetter
@ 2017-06-15  6:43   ` gregkh
  0 siblings, 0 replies; 3+ messages in thread
From: gregkh @ 2017-06-15  6:43 UTC (permalink / raw)
  To: daniel.vetter, chris, daniel.vetter, gregkh, intel-gfx,
	jani.nikula, joonas.lahtinen, mael.lavault, michal.winiarski,
	michel.thierry, mika.kuoppala, stable
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    drm/i915: Do not drop pagetables when empty

to the 4.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-i915-do-not-drop-pagetables-when-empty.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From daniel.vetter@ffwll.ch  Thu Jun 15 08:32:03 2017
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Fri, 26 May 2017 10:29:06 +0200
Subject: drm/i915: Do not drop pagetables when empty
To: Intel Graphics Development <intel-gfx@lists.freedesktop.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>, Jani Nikula <jani.nikula@linux.intel.com>, "# v4 . 10+" <stable@vger.kernel.org>
Message-ID: <20170526082906.8982-1-daniel.vetter@ffwll.ch>


From: Chris Wilson <chris@chris-wilson.co.uk>

This is the minimal backport for stable of the upstream commit:

commit dd19674bacba227ae5d3ce680cbc5668198894dc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Feb 15 08:43:46 2017 +0000

    drm/i915: Remove bitmap tracking for used-ptes

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_gem_gtt.c |   10 ----------
 1 file changed, 10 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+
Tested-by: Maël Lavault <mael.lavault@protonmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

--- 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 i
 	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 i
 		}
 	}
 
-	if (bitmap_empty(pd->used_pdes, I915_PDES))
-		return true;
-
 	return false;
 }
 
@@ -829,9 +822,6 @@ static bool gen8_ppgtt_clear_pdp(struct
 
 	mark_tlbs_dirty(ppgtt);
 
-	if (bitmap_empty(pdp->used_pdpes, I915_PDPES_PER_PDP(dev_priv)))
-		return true;
-
 	return false;
 }
 


Patches currently in stable-queue which might be from daniel.vetter@ffwll.ch are

queue-4.11/drm-i915-do-not-drop-pagetables-when-empty.patch

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Patch "drm/i915: Do not drop pagetables when empty" has been added to the 4.11-stable tree
@ 2017-06-15  6:43   ` gregkh
  0 siblings, 0 replies; 3+ messages in thread
From: gregkh @ 2017-06-15  6:43 UTC (permalink / raw)
  To: daniel.vetter, chris, daniel.vetter, gregkh, intel-gfx,
	jani.nikula, joonas.lahtinen, mael.lavault, michal.winiarski,
	michel.thierry, mika.kuoppala
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    drm/i915: Do not drop pagetables when empty

to the 4.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-i915-do-not-drop-pagetables-when-empty.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From daniel.vetter@ffwll.ch  Thu Jun 15 08:32:03 2017
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Fri, 26 May 2017 10:29:06 +0200
Subject: drm/i915: Do not drop pagetables when empty
To: Intel Graphics Development <intel-gfx@lists.freedesktop.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>, Jani Nikula <jani.nikula@linux.intel.com>, "# v4 . 10+" <stable@vger.kernel.org>
Message-ID: <20170526082906.8982-1-daniel.vetter@ffwll.ch>


From: Chris Wilson <chris@chris-wilson.co.uk>

This is the minimal backport for stable of the upstream commit:

commit dd19674bacba227ae5d3ce680cbc5668198894dc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Feb 15 08:43:46 2017 +0000

    drm/i915: Remove bitmap tracking for used-ptes

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_gem_gtt.c |   10 ----------
 1 file changed, 10 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+
Tested-by: Maël Lavault <mael.lavault@protonmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

--- 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 i
 	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 i
 		}
 	}
 
-	if (bitmap_empty(pd->used_pdes, I915_PDES))
-		return true;
-
 	return false;
 }
 
@@ -829,9 +822,6 @@ static bool gen8_ppgtt_clear_pdp(struct
 
 	mark_tlbs_dirty(ppgtt);
 
-	if (bitmap_empty(pdp->used_pdpes, I915_PDPES_PER_PDP(dev_priv)))
-		return true;
-
 	return false;
 }
 


Patches currently in stable-queue which might be from daniel.vetter@ffwll.ch are

queue-4.11/drm-i915-do-not-drop-pagetables-when-empty.patch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-15  6:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26  8:29 [PATCH] drm/i915: Do not drop pagetables when empty Daniel Vetter
2017-06-15  6:43 ` Patch "drm/i915: Do not drop pagetables when empty" has been added to the 4.11-stable tree gregkh
2017-06-15  6:43   ` gregkh

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.