Whamcloud - gitweb
- fix slow increasing of recovery time
authortappro <tappro>
Tue, 9 Sep 2008 06:05:00 +0000 (06:05 +0000)
committertappro <tappro>
Tue, 9 Sep 2008 06:05:00 +0000 (06:05 +0000)
  b:16389
  i:nathan, rread

lustre/include/lustre_import.h

index f515d95..96d5f8b 100644 (file)
@@ -172,6 +172,18 @@ struct obd_import {
 };
 
 /* import.c */
+static inline unsigned int at_est2timeout(unsigned int val)
+{
+        /* add an arbitrary minimum: 125% +5 sec */
+        return (val + (val >> 2) + 5);
+}
+
+static inline unsigned int at_timeout2est(unsigned int val)
+{
+        /* restore estimate value from timeout */
+        return ((val - 1) / 5 * 4);
+}
+
 static inline void at_init(struct adaptive_timeout *at, int val, int flags) {
         memset(at, 0, sizeof(*at));
         at->at_current = val;