All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i915: slab shrinker have to return -1 if it can't shrink any objects
@ 2011-06-24  8:03 KOSAKI Motohiro
  2011-06-30  3:53   ` Keith Packard
  0 siblings, 1 reply; 15+ messages in thread
From: KOSAKI Motohiro @ 2011-06-24  8:03 UTC (permalink / raw)
  To: linux-kernel, keithp, airlied, dri-devel; +Cc: kosaki.motohiro

Now, i915_gem_inactive_shrink() should return -1 instead of 0 if it
can't take a lock. Otherwise, vmscan is getting a lot of confusing
because vmscan can't distinguish "can't take a lock temporary" and
"we've shrank all of i915 objects".

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Keith Packard <keithp@keithp.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
---

I've found this issue by reviewing. I hope i915 developers confirm this.
Thx.


 drivers/gpu/drm/i915/i915_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 94c84d7..2f9a9b2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4104,7 +4104,7 @@ i915_gem_inactive_shrink(struct shrinker *shrinker, struct shrink_control *sc)
 	int cnt;

 	if (!mutex_trylock(&dev->struct_mutex))
-		return 0;
+		return nr_to_scan ? -1 : 0;

 	/* "fast-path" to count number of available objects */
 	if (nr_to_scan == 0) {
-- 
1.7.3.1




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

end of thread, other threads:[~2011-07-14  3:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-24  8:03 [PATCH] i915: slab shrinker have to return -1 if it can't shrink any objects KOSAKI Motohiro
2011-06-30  3:53 ` Keith Packard
2011-06-30  3:53   ` Keith Packard
2011-06-30  8:55   ` [PATCH] i915: slab shrinker have to return -1 if it cant " Chris Wilson
2011-06-30  8:55     ` Chris Wilson
2011-07-12  9:36     ` KOSAKI Motohiro
2011-07-12 10:06       ` Chris Wilson
2011-07-13  0:19         ` KOSAKI Motohiro
2011-07-13  7:41           ` Chris Wilson
2011-07-13  8:19             ` KOSAKI Motohiro
2011-07-13  8:40               ` Chris Wilson
2011-07-13 11:34                 ` Dave Chinner
2011-07-13 10:42               ` Dave Chinner
2011-07-14  2:48                 ` KOSAKI Motohiro
2011-07-14  3:47                   ` Dave Chinner

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.