Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/i915: Do not sync RCU during shrinking" failed to apply to 4.11-stable tree

PATCH [email protected] 2 participants 3 messages Jun 15, 2017 – Jun 18, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.11-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 4681ee21d62cfed4364e09ec50ee8e88185dd628 Mon Sep 17 00:00:00 2001

From: Joonas Lahtinen <[email protected]>
Date: Thu, 18 May 2017 11:49:39 +0300
Subject: [PATCH] drm/i915: Do not sync RCU during shrinking

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")
Cc Chris Wilson <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc J. R. Okajima <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Jani Nikula <[email protected]>
Cc <[email protected]> # v4.11+
(cherry picked from commit 73cc0b9aa9afa5ba65d92e46ded61d29430d72a4)
drivers/gpu/drm/i915/i915_gem_shrinker.c +0 -5
index 129ed303a6c4..57d9f7f4ef15 100644
@@ -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;
 }
 
Reviewed-by Chris Wilson Tested-by Tested-by Andrea Arcangeli
#1 lore raw

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 4681ee21d62cfed4364e09ec50ee8e88185dd628 Mon Sep 17 00:00:00 2001

From: Joonas Lahtinen <[email protected]>
Date: Thu, 18 May 2017 11:49:39 +0300
Subject: [PATCH] drm/i915: Do not sync RCU during shrinking

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")
Cc Chris Wilson <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc J. R. Okajima <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Jani Nikula <[email protected]>
Cc <[email protected]> # v4.11+
(cherry picked from commit 73cc0b9aa9afa5ba65d92e46ded61d29430d72a4)
drivers/gpu/drm/i915/i915_gem_shrinker.c +0 -5
@@ -59,9 +59,6 @@ static void i915_gem_shrinker_unlock(str
 		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)
@@ -271,8 +268,6 @@ unsigned long i915_gem_shrink_all(struct
 				I915_SHRINK_BOUND |
 				I915_SHRINK_UNBOUND |
 				I915_SHRINK_ACTIVE);
-	synchronize_rcu(); /* wait for our earlier RCU delayed slab frees */
-
 	return freed;
 }
 
author maintainer
#2 lore raw
Quoted 6 lines · Hugh Dickins

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 4681ee21d62cfed4364e09ec50ee8e88185dd628 Mon Sep 17 00:00:00 2001

From: Joonas Lahtinen <[email protected]>
Date: Thu, 18 May 2017 11:49:39 +0300
Subject: [PATCH] drm/i915: Do not sync RCU during shrinking

Many thanks for this, now applied.

greg k-h