Re: [Cluster-devel] [RHEL7.9.z PATCH 1/2] gfs2: Add common helper for holding and releasing the freeze glock

2020-12-14 Thread Andreas Gruenbacher
Hi Bob, On Thu, Dec 3, 2020 at 4:23 PM Bob Peterson wrote: > Many places in the gfs2 code queued and dequeued the freeze glock. > Almost all of them acquire it in SHARED mode, and need to specify the > same LM_FLAG_NOEXP and GL_EXACT flags. > > This patch adds common helper functions gfs2_freeze_

Re: [Cluster-devel] [PATCH 07/12] gfs2: Get rid of on-stack transactions

2020-12-14 Thread Andreas Gruenbacher
On Mon, Dec 14, 2020 at 3:06 PM Steven Whitehouse wrote: > On 14/12/2020 14:02, Bob Peterson wrote: > > Hi, > > > > - Original Message - > >> +ret = __gfs2_trans_begin(sdp, 0, revokes, GFP_NOFS | __GFP_NOFAIL); > > The addition of __GFP_NOFAIL means that this operation can now block. >

Re: [Cluster-devel] [PATCH 07/12] gfs2: Get rid of on-stack transactions

2020-12-14 Thread Steven Whitehouse
Hi, On 14/12/2020 14:02, Bob Peterson wrote: Hi, - Original Message - + ret = __gfs2_trans_begin(sdp, 0, revokes, GFP_NOFS | __GFP_NOFAIL); The addition of __GFP_NOFAIL means that this operation can now block. Looking at the code, I don't think it will be a problem because it ca

Re: [Cluster-devel] [PATCH 07/12] gfs2: Get rid of on-stack transactions

2020-12-14 Thread Bob Peterson
Hi, - Original Message - > + ret = __gfs2_trans_begin(sdp, 0, revokes, GFP_NOFS | __GFP_NOFAIL); The addition of __GFP_NOFAIL means that this operation can now block. Looking at the code, I don't think it will be a problem because it can already block in the log_flush operations that

Re: [Cluster-devel] Recording extents in GFS2

2020-12-14 Thread Steven Whitehouse
Hi, On 11/12/2020 16:38, Abhijith Das wrote: Hi all, With a recent set of patches, we nearly eliminated the per_node statfs change files by recording that info in the journal. The files and some recovery code remain only for backward compatibility. Similarly, I'd like to get rid of the per_node

[Cluster-devel] [PATCH 12/12] gfs2: Use a tighter bound in gfs2_trans_begin

2020-12-14 Thread Andreas Gruenbacher
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(+),

[Cluster-devel] [PATCH 10/12] gfs2: Don't wait for journal flush in clean_journal

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [PATCH 11/12] gfs2: Clean up gfs2_log_reserve

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [PATCH 09/12] gfs2: Move lock flush locking to gfs2_trans_{begin, end}

2020-12-14 Thread Andreas Gruenbacher
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 +++-

[Cluster-devel] [PATCH 03/12] gfs2: Minor gfs2_write_revokes cleanups

2020-12-14 Thread Andreas Gruenbacher
Clean up the computations in gfs2_write_revokes (no change in functionality). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 2e9314091c81..c65fdb1a30a0 100644 --- a/fs/gfs2/log.c

[Cluster-devel] [PATCH 07/12] gfs2: Get rid of on-stack transactions

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [PATCH 04/12] gfs2: Some documentation clarifications

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [PATCH 08/12] gfs2: Get rid of sd_reserving_log

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [PATCH 06/12] gfs2: Clean up ail2_empty

2020-12-14 Thread Andreas Gruenbacher
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 f7c225520c38..33f7b1544958 100644 --- a/f

[Cluster-devel] [PATCH 05/12] gfs2: A minor debugging improvement

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [PATCH 02/12] gfs2: Simplify the buf_limit and databuf_limit definitions

2020-12-14 Thread Andreas Gruenbacher
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

[Cluster-devel] [RFC PATCH 00/12] Some log space management cleanups

2020-12-14 Thread Andreas Gruenbacher
Hello, here's a bit of fallout in the log space management code that resulted from looking into a revokes accounting problem in conjunction with the resource group glock sharing patches. I'm still working on some follow-up changes, but this patch set should be reasonably self-contained. Please r

[Cluster-devel] [PATCH 01/12] gfs2: Deobfuscate function jdesc_find_i

2020-12-14 Thread Andreas Gruenbacher
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 b3d951ab8068..08aef061b29d 100644 --- a/fs/gfs2/super.c +++ b/fs/gf