]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Per-revoke accounting in transactions
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 17 Dec 2020 15:14:30 +0000 (16:14 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 22 Feb 2021 20:16:23 +0000 (21:16 +0100)
commit49978d6e5bf1f9b1e865d64d633c90ef259495ab
tree94a1bf3898930c5b7c62eaaa00ee27a4287b5133
parentaec0f01b583ca2cca9bce790275f6ee5e269b002
gfs2: Per-revoke accounting in transactions

In the log, revokes are stored as a revoke descriptor (struct
gfs2_log_descriptor), followed by zero or more additional revoke blocks
(struct gfs2_meta_header).  On filesystems with a blocksize of 4k, the
revoke descriptor contains up to 503 revokes, and the metadata blocks
contain up to 509 revokes each.  We've so far been reserving space for
revokes in transactions in block granularity, so a lot more space than
necessary was being allocated and then released again.

This patch switches to assigning revokes to transactions individually
instead.  Initially, space for the revoke descriptor is reserved and
handed out to transactions.  When more revokes than that are reserved,
additional revoke blocks are added.  When the log is flushed, the space
for the additional revoke blocks is released, but we keep the space for
the revoke descriptor block allocated.

Transactions may still reserve more revokes than they will actually need
in the end, but now we won't overshoot the target as much, and by only
returning the space for excess revokes at log flush time, we further
reduce the amount of contention between processes.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/log.c
fs/gfs2/log.h
fs/gfs2/lops.c
fs/gfs2/ops_fstype.c
fs/gfs2/trans.c