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>
Mon, 5 Mar 2012 07:58:22 +0000 (02:58 -0500)
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 0864f74..1f8f829 100644 (file)
@@ -1150,7 +1150,9 @@ static int ldlm_pools_shrink(ldlm_side_t client, int nr,
                 ldlm_namespace_put(ns);
         }
         cl_env_reexit(cookie);
                 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_ARGS(sc, nr_to_scan, gfp_mask))
 }
 
 static int ldlm_pools_srv_shrink(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask))