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 revoke
The current log space allocation logic is hard to understand or extend.
The principle it that when the log is flushed, we may or may not have a
transaction active that has space allocated in the log. To deal with
that, we set aside a magical number of blocks to be used in case we
don't have an act
Commit 588bff95c94e added gfs2_write_log_header() and started using it in
clean_journal(), with an additional call to log_flush_wait() at the end of
gfs2_write_log_header() which is unnecessary for clean_journal(). Move
that call out of gfs2_write_log_header() to restore the previous behavior.
Si
Now that sdp->sd_log_tr is defined even when the transaction only
indicates revokes, tr_reserved is equivalent to sd_log_blks_reserved,
so we can remove it.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/incore.h | 1 -
fs/gfs2/log.c| 21 ++---
fs/gfs2/log.h| 2 +-
fs/g
Keep the current value of the updated log tail in the super block as
sb_log_flush_tail instead of computing it on the fly. This avoids
unnecessary sd_ail_lock taking and cleans up the code.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/incore.h | 5 ++--
fs/gfs2/log.c| 72
In gfs2_trans_end -> gfs2_log_commit -> gfs2_log_refund, if we don't have a
system transaction, always attach the new transaction even if it only accounts
for revokes. That way, tr_num_revoke - tr_num_revoke_rm in the system
transaction
(sdp->sd_log_tr) will be the number of revokes committed so
Wake up log waiters in gfs2_log_release when log space has actually become
available. This is a much better place for the wakeup than gfs2_logd.
Check if enough log space is immeditely available before anything else. If
there isn't, use io_wait_event to wait instead of open-coding it.
Signed-of
Move this function further up in log.c so that we can use it in the next patch.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/log.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 1ca5f2c468d5..f3b11bb7
Use a tighter bound for the number of blocks required by transactions in
gfs2_trans_begin: in the worst case, we'll have mixed data and metadata,
so we'll need a log desciptor for each type.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/trans.c | 10 --
1 file changed, 8 insertions(+),
This counter and the associated wait queue are only used so that
gfs2_make_fs_ro can efficiently wait for all pending log space
allocations to fail after setting the filesystem to read-only. This
comes at the cost of waking up that wait queue very frequently.
Instead, when gfs2_log_reserve fails
Split the assert in gfs2_trans_end into two parts.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/trans.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 6d4bf7ea7b3b..7705f04621f4 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
Clean up the logic in ail2_empty (no functional change).
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/log.c | 38 +-
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 7375c007bde5..e4dc23a24569 100644
--- a/f
The calc_reserved description claims that buf_limit is 502 (on 4k
filesystems), but it is actually 503. Fix / clarify the entire
description.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/log.c | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/fs/gf
Clean up this function to show that it is trivial.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/super.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 2f56acc41c04..ed7a829e9ffe 100644
--- a/fs/gfs2/super.c
+++ b/fs/gf
In gfs2_log_flush, we're going through all active transactions. For
each of the buffers in those transactions that has completed, we either
add a revoke to the active transaction immediately, or we move the
buffer to the transaction's ail2 list, which may result in a revoke
later.
However, whenev
The BUF_OFFSET and DATABUF_OFFSET definitions are only used in buf_limit
and databuf_limit, respectively, and the rounding done in those
definitions is immediately wiped out by dividing by the element size.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/lops.h | 17 ++---
1 file chan
On-stack transactions were introduced to work around a transaction glock
deadlock in gfs2_trans_begin in commit d8348de06f70 ("GFS2: Fix deadlock
on journal flush"). Subsequently, transaction glocks were eliminated in
favor of the more efficient freeze glocks in commit 24972557b12c ("GFS2:
remove
Hello,
here's another update on the log log space management cleanup. The
changes are mostly in the topmost patch ("gfs2: Per-revoke accounting in
transactions"), which still had several bugs in v2. Please review.
Thanks,
Andreas
Andreas Gruenbacher (20):
gfs2: Un-obfuscate function jdesc_fi
Move the read locking of sd_log_flush_lock from gfs2_log_reserve to
gfs2_trans_begin, and its unlocking from gfs2_log_release to
gfs2_trans_end. Use gfs2_log_release in two places in which it was open
coded before.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/log.c | 28 +++-
Function gfs2_write_revokes doesn't actually write any revokes; instead, it
adds revokes to the system transaction during a flush.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/log.c | 4 ++--
fs/gfs2/log.h | 2 +-
fs/gfs2/lops.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff
Clean up the computations in gfs2_write_revokes (no change in functionality).
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/log.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 2e9314091c81..ccce17fe605f 100644
--- a/fs/gfs2/log.c
21 matches
Mail list logo