summaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2024-09-13 23:07:31 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2024-11-05 12:39:29 +0100
commit085e423b4d51dfe71e1967c9e508d1cb845063d3 (patch)
tree0651fefa45b49544c09b7f1657e6bdf0a470fd3c /fs/gfs2
parentf6ca45e3d2b97ddb4bfcbbe44d1dd18374cd6f85 (diff)
downloadlinux-085e423b4d51dfe71e1967c9e508d1cb845063d3.tar.gz
linux-085e423b4d51dfe71e1967c9e508d1cb845063d3.tar.bz2
linux-085e423b4d51dfe71e1967c9e508d1cb845063d3.zip
gfs2: Randomize GLF_VERIFY_DELETE work delay
Randomize the delay of GLF_VERIFY_DELETE work. This avoids thundering herd problems when multiple nodes schedule that kind of work in response to an inode being unlinked remotely. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/glock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 5455f4dd14a3..46a6e97cd930 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -36,6 +36,7 @@
#include <linux/pid_namespace.h>
#include <linux/fdtable.h>
#include <linux/file.h>
+#include <linux/random.h>
#include "gfs2.h"
#include "incore.h"
@@ -1018,7 +1019,7 @@ bool gfs2_queue_verify_delete(struct gfs2_glock *gl, bool later)
if (test_and_set_bit(GLF_VERIFY_DELETE, &gl->gl_flags))
return false;
- delay = later ? 5 * HZ : 0;
+ delay = later ? HZ + get_random_long() % (HZ * 9) : 0;
return queue_delayed_work(sdp->sd_delete_wq, &gl->gl_delete, delay);
}