* [BACKPORT v4.12-rc1] drm/i915: Do not sync RCU during shrinking
@ 2017-05-18 8:49 Joonas Lahtinen
2017-05-18 11:28 ` Jani Nikula
0 siblings, 1 reply; 2+ messages in thread
From: Joonas Lahtinen @ 2017-05-18 8:49 UTC (permalink / raw)
To: Intel graphics driver community testing & development
Cc: Jani Nikula, stable
Due to the complex dependencies between workqueues and RCU, which
are not easily detected by lockdep, do not synchronize RCU during
shrinking.
On low-on-memory systems (mem=1G for example), the RCU sync leads
to all system workqueus freezing and unrelated lockdep splats are
displayed according to reports. GIT bisecting done by J. R.
Okajima points to the commit where RCU syncing was extended.
RCU sync gains us very little benefit in real life scenarios
where the amount of memory used by object backing storage is
dominant over the metadata under RCU, so drop it altogether.
" Yeeeaah, if core could just, go ahead and reclaim RCU
queues, that'd be great. "
- Chris Wilson, 2016 (0eafec6d3244)
v2: More information to commit message.
v3: Remove "grep _rcu_" escapee from i915_gem_shrink_all (Andrea)
Fixes: c053b5a506d3 ("drm/i915: Don't call synchronize_rcu_expedited under struct_mutex")
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: J. R. Okajima <hooanon05g@gmail.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: J. R. Okajima <hooanon05g@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: <stable@vger.kernel.org> # v4.11+
---
drivers/gpu/drm/i915/i915_gem_shrinker.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index 129ed30..57d9f7f 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -59,9 +59,6 @@ static void i915_gem_shrinker_unlock(struct drm_device *dev, bool unlock)
return;
mutex_unlock(&dev->struct_mutex);
-
- /* expedite the RCU grace period to free some request slabs */
- synchronize_rcu_expedited();
}
static bool any_vma_pinned(struct drm_i915_gem_object *obj)
@@ -274,8 +271,6 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv)
I915_SHRINK_ACTIVE);
intel_runtime_pm_put(dev_priv);
- synchronize_rcu(); /* wait for our earlier RCU delayed slab frees */
-
return freed;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [BACKPORT v4.12-rc1] drm/i915: Do not sync RCU during shrinking
2017-05-18 8:49 [BACKPORT v4.12-rc1] drm/i915: Do not sync RCU during shrinking Joonas Lahtinen
@ 2017-05-18 11:28 ` Jani Nikula
0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2017-05-18 11:28 UTC (permalink / raw)
To: Joonas Lahtinen,
Intel graphics driver community testing & development
Cc: stable
On Thu, 18 May 2017, Joonas Lahtinen <joonas.lahtinen@linux.intel.com> wrote:
> Due to the complex dependencies between workqueues and RCU, which
> are not easily detected by lockdep, do not synchronize RCU during
> shrinking.
>
> On low-on-memory systems (mem=1G for example), the RCU sync leads
> to all system workqueus freezing and unrelated lockdep splats are
> displayed according to reports. GIT bisecting done by J. R.
> Okajima points to the commit where RCU syncing was extended.
>
> RCU sync gains us very little benefit in real life scenarios
> where the amount of memory used by object backing storage is
> dominant over the metadata under RCU, so drop it altogether.
>
> " Yeeeaah, if core could just, go ahead and reclaim RCU
> queues, that'd be great. "
>
> - Chris Wilson, 2016 (0eafec6d3244)
>
> v2: More information to commit message.
> v3: Remove "grep _rcu_" escapee from i915_gem_shrink_all (Andrea)
>
> Fixes: c053b5a506d3 ("drm/i915: Don't call synchronize_rcu_expedited under struct_mutex")
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reported-by: J. R. Okajima <hooanon05g@gmail.com>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Tested-by: Hugh Dickins <hughd@google.com>
> Tested-by: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: J. R. Okajima <hooanon05g@gmail.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: <stable@vger.kernel.org> # v4.11+
Pushed to drm-intel-fixes, thanks for the patch.
BR,
Jani.
> ---
> drivers/gpu/drm/i915/i915_gem_shrinker.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
> index 129ed30..57d9f7f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
> +++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
> @@ -59,9 +59,6 @@ static void i915_gem_shrinker_unlock(struct drm_device *dev, bool unlock)
> return;
>
> mutex_unlock(&dev->struct_mutex);
> -
> - /* expedite the RCU grace period to free some request slabs */
> - synchronize_rcu_expedited();
> }
>
> static bool any_vma_pinned(struct drm_i915_gem_object *obj)
> @@ -274,8 +271,6 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv)
> I915_SHRINK_ACTIVE);
> intel_runtime_pm_put(dev_priv);
>
> - synchronize_rcu(); /* wait for our earlier RCU delayed slab frees */
> -
> return freed;
> }
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-18 11:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-18 8:49 [BACKPORT v4.12-rc1] drm/i915: Do not sync RCU during shrinking Joonas Lahtinen
2017-05-18 11:28 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).