summaryrefslogtreecommitdiff
path: root/fs/gfs2/lock_dlm.c
diff options
context:
space:
mode:
authorpopcornmix <popcornmix@gmail.com>2019-06-10 15:08:23 +0100
committerpopcornmix <popcornmix@gmail.com>2019-06-10 15:08:23 +0100
commit4395da03133888a4d2ea920dfb88d04e7534038d (patch)
tree82770cb27e36df3aa4433a4a0a3e53a2f88a05b1 /fs/gfs2/lock_dlm.c
parent6b45ec4c1518201aed352f9c9a852613adfd6efb (diff)
parentbb7b450e61a1dbe2bfbe998a1afeda654c6a67e9 (diff)
downloadlinux-rpi3-4395da03133888a4d2ea920dfb88d04e7534038d.tar.gz
linux-rpi3-4395da03133888a4d2ea920dfb88d04e7534038d.tar.bz2
linux-rpi3-4395da03133888a4d2ea920dfb88d04e7534038d.zip
Merge remote-tracking branch 'stable/linux-4.19.y' into rpi-4.19.y
Diffstat (limited to 'fs/gfs2/lock_dlm.c')
-rw-r--r--fs/gfs2/lock_dlm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index ac7caa267ed6..62edf8f5615f 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -31,9 +31,10 @@
* @delta is the difference between the current rtt sample and the
* running average srtt. We add 1/8 of that to the srtt in order to
* update the current srtt estimate. The variance estimate is a bit
- * more complicated. We subtract the abs value of the @delta from
- * the current variance estimate and add 1/4 of that to the running
- * total.
+ * more complicated. We subtract the current variance estimate from
+ * the abs value of the @delta and add 1/4 of that to the running
+ * total. That's equivalent to 3/4 of the current variance
+ * estimate plus 1/4 of the abs of @delta.
*
* Note that the index points at the array entry containing the smoothed
* mean value, and the variance is always in the following entry
@@ -49,7 +50,7 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
s64 delta = sample - s->stats[index];
s->stats[index] += (delta >> 3);
index++;
- s->stats[index] += ((abs(delta) - s->stats[index]) >> 2);
+ s->stats[index] += (s64)(abs(delta) - s->stats[index]) >> 2;
}
/**