Skip to content

Commit 085e423

Browse files
author
Andreas Gruenbacher
committed
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 <[email protected]>
1 parent f6ca45e commit 085e423

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/gfs2/glock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <linux/pid_namespace.h>
3737
#include <linux/fdtable.h>
3838
#include <linux/file.h>
39+
#include <linux/random.h>
3940

4041
#include "gfs2.h"
4142
#include "incore.h"
@@ -1018,7 +1019,7 @@ bool gfs2_queue_verify_delete(struct gfs2_glock *gl, bool later)
10181019

10191020
if (test_and_set_bit(GLF_VERIFY_DELETE, &gl->gl_flags))
10201021
return false;
1021-
delay = later ? 5 * HZ : 0;
1022+
delay = later ? HZ + get_random_long() % (HZ * 9) : 0;
10221023
return queue_delayed_work(sdp->sd_delete_wq, &gl->gl_delete, delay);
10231024
}
10241025

0 commit comments

Comments
 (0)