linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix up usage of SHRINK_STOP
@ 2013-09-25 12:00 Daniel Vetter
  2013-09-25 22:26 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Vetter @ 2013-09-25 12:00 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: DRI Development, Linux MM, Daniel Vetter, Knut Petersen,
	Dave Chinner, Glauber Costa, Glauber Costa, Andrew Morton,
	Rik van Riel, Mel Gorman, Johannes Weiner, Michal Hocko

In

commit 81e49f811404f428a9d9a63295a0c267e802fa12
Author: Glauber Costa <glommer@openvz.org>
Date:   Wed Aug 28 10:18:13 2013 +1000

    i915: bail out earlier when shrinker cannot acquire mutex

SHRINK_STOP was added to tell the core shrinker code to bail out and
go to the next shrinker since the i915 shrinker couldn't acquire
required locks. But the SHRINK_STOP return code was added to the
->count_objects callback and not the ->scan_objects callback as it
should have been, resulting in tons of dmesg noise like

shrink_slab: i915_gem_inactive_scan+0x0/0x9c negative objects to delete nr=-xxxxxxxxx

Fix discusssed with Dave Chinner.

References: http://www.spinics.net/lists/intel-gfx/msg33597.html
Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
Cc: Knut Petersen <Knut_Petersen@t-online.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Glauber Costa <glommer@openvz.org>
Cc: Glauber Costa <glommer@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_gem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index df9253d..cdfb9da 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4800,10 +4800,10 @@ i915_gem_inactive_count(struct shrinker *shrinker, struct shrink_control *sc)
 
 	if (!mutex_trylock(&dev->struct_mutex)) {
 		if (!mutex_is_locked_by(&dev->struct_mutex, current))
-			return SHRINK_STOP;
+			return 0;
 
 		if (dev_priv->mm.shrinker_no_lock_stealing)
-			return SHRINK_STOP;
+			return 0;
 
 		unlock = false;
 	}
@@ -4901,10 +4901,10 @@ i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc)
 
 	if (!mutex_trylock(&dev->struct_mutex)) {
 		if (!mutex_is_locked_by(&dev->struct_mutex, current))
-			return 0;
+			return SHRINK_STOP;
 
 		if (dev_priv->mm.shrinker_no_lock_stealing)
-			return 0;
+			return SHRINK_STOP;
 
 		unlock = false;
 	}
-- 
1.8.4.rc3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] drm/i915: Fix up usage of SHRINK_STOP
  2013-09-25 12:00 [PATCH] drm/i915: Fix up usage of SHRINK_STOP Daniel Vetter
@ 2013-09-25 22:26 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2013-09-25 22:26 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Intel Graphics Development, DRI Development, Linux MM,
	Knut Petersen, Glauber Costa, Glauber Costa, Andrew Morton,
	Rik van Riel, Mel Gorman, Johannes Weiner, Michal Hocko

On Wed, Sep 25, 2013 at 02:00:02PM +0200, Daniel Vetter wrote:
> In
> 
> commit 81e49f811404f428a9d9a63295a0c267e802fa12
> Author: Glauber Costa <glommer@openvz.org>
> Date:   Wed Aug 28 10:18:13 2013 +1000
> 
>     i915: bail out earlier when shrinker cannot acquire mutex
> 
> SHRINK_STOP was added to tell the core shrinker code to bail out and
> go to the next shrinker since the i915 shrinker couldn't acquire
> required locks. But the SHRINK_STOP return code was added to the
> ->count_objects callback and not the ->scan_objects callback as it
> should have been, resulting in tons of dmesg noise like
> 
> shrink_slab: i915_gem_inactive_scan+0x0/0x9c negative objects to delete nr=-xxxxxxxxx
> 
> Fix discusssed with Dave Chinner.

Acked-by: Dave Chinner <dchinner@redhat.com>

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-09-25 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25 12:00 [PATCH] drm/i915: Fix up usage of SHRINK_STOP Daniel Vetter
2013-09-25 22:26 ` Dave Chinner

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).