Whamcloud - gitweb
LU-1535 ldlm: backport fix for LU-1128
authorLai Siyao <laisiyao@whamcloud.com>
Tue, 19 Jun 2012 08:58:41 +0000 (16:58 +0800)
committerJohann Lombardi <johann@whamcloud.com>
Thu, 21 Jun 2012 17:01:33 +0000 (13:01 -0400)
Backport fix for LU-1128 to 1.8:
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: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: I1c841e7485375017d33e93c59f2318318fae299c
Reviewed-on: http://review.whamcloud.com/3138
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/ldlm/ldlm_pool.c

index 6945ed2..20678aa 100644 (file)
@@ -1125,7 +1125,9 @@ static int ldlm_pools_shrink(ldlm_side_t client, int nr,
                 cached += ldlm_pool_granted(&ns->ns_pool);
                 ldlm_namespace_put(ns, 1);
         }
-        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,