From: Bob Peterson Date: Tue, 9 Jan 2018 08:53:06 -0500 (EST) Subject: [Cluster-devel] [PATCH 05/12] gfs2: Remove minor gfs2_journaled_truncate inefficiencies In-Reply-To: <20171222143507.26680-6-agruenba@redhat.com> References: <20171222143507.26680-1-agruenba@redhat.com> <20171222143507.26680-6-agruenba@redhat.com> Message-ID: <1645375076.4385389.1515505986494.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, ----- Original Message ----- | First, this function truncates the file in chunks. When the original | file size isn't block aligned, each chunk that is truncated will remain | be misaligned. This is inefficient. | | Second, this function doesn't recognize where holes are, so it loops | through them. For each chunk of a hole, it creates a new transaction. | At least avoid creating another transactions whe the current one is | still empty. (An better fix would be to skip large holes, of course.) | | Signed-off-by: Andreas Gruenbacher | --- (snip) | + /* XXX Is this check sufficient? */ | + tr = current->journal_info; | + if (!tr->tr_num_revoke) | + continue; Maybe I'm missing your intent here, but perhaps you can use this: if (!test_bit(TR_TOUCHED, &tr->tr_flags)) { like gfs2_trans_end does for determining whether the transaction was actually used. Regards, Bob Peterson Red Hat File Systems