Whamcloud - gitweb
LU-1128 ldlm: return -1 for server pool shrinker
authorNiu Yawei <niu@whamcloud.com>
Fri, 24 Feb 2012 05:21:51 +0000 (21:21 -0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 16 Mar 2012 01:47:01 +0000 (21:47 -0400)
For ldlm server pool shrinker, we just use it to decrease SLV,
but never reclaim any memory directly, so it should always return
-1 to inform the kernel to break the shrink loop.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I17f51ac84eb0b8c70b2cee9ac7eeca34647c1990
Reviewed-on: http://review.whamcloud.com/2184
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_pool.c

index 7a88c4d..97b8428 100644 (file)
@@ -1151,7 +1151,9 @@ static int ldlm_pools_shrink(ldlm_side_t client, int nr,
                 ldlm_namespace_put(ns);
         }
         cl_env_reexit(cookie);
-        return cached;
+        /* we only decrease the SLV in server pools shrinker, return -1 to
+         * kernel to avoid needless loop. LU-1128 */
+        return (client == LDLM_NAMESPACE_SERVER) ? -1 : cached;
 }
 
 static int ldlm_pools_srv_shrink(SHRINKER_FIRST_ARG int nr_to_scan,