summaryrefslogtreecommitdiff
path: root/fs/ocfs2/dlmglue.h
diff options
context:
space:
mode:
authorGang He <ghe@suse.com>2018-01-31 16:15:13 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-31 17:18:35 -0800
commit637dd20c490386c725ab21f3eb763a36fd0a5fb0 (patch)
tree15ded5c1dec040323415c0281bc415ec3ca91cf8 /fs/ocfs2/dlmglue.h
parent4882abebccb58d68056462b66cea0d7f16169c39 (diff)
ocfs2: add trimfs lock to avoid duplicated trims in cluster
ocfs2 supports trimming the underlying disk via the fstrim command. But there is a problem, ocfs2 is a shared disk cluster file system, if the user configures a scheduled fstrim job on each file system node, this will trigger multiple nodes trimming a shared disk simultaneously, which is very wasteful for CPU and IO consumption. This also might negatively affect the lifetime of poor-quality SSD devices. So we introduce a trimfs dlm lock to communicate with each other in this case, which will make only one fstrim command to do the trimming on a shared disk among the cluster. The fstrim commands from the other nodes should wait for the first fstrim to finish and return success directly, to avoid running the same trim on the shared disk again. Link: http://lkml.kernel.org/r/1513228484-2084-2-git-send-email-ghe@suse.com Signed-off-by: Gang He <ghe@suse.com> Reviewed-by: Changwei Ge <ge.changwei@h3c.com> Cc: Mark Fasheh <mfasheh@versity.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Joseph Qi <jiangqi903@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/dlmglue.h')
0 files changed, 0 insertions, 0 deletions