[Cluster-devel] [PATCH 05/12] gfs2: Remove minor gfs2_journaled_truncate inefficiencies

Bob Peterson rpeterso at redhat.com
Tue Jan 9 13:53:06 UTC 2018


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 <agruenba at redhat.com>
| ---
(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




More information about the Cluster-devel mailing list