Skip to contentSkip to conversation

Don't output rgrps at every bit change during unlink

PATCH New Bob Peterson 1 participant 1 message Mar 16, 2011 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1579690859.468477.1300283645569.JavaMail.root@zmail06.collab.prod.int.phx2.redhat.com

#1 lore raw

PATCH 1/1 Don't output rgrps at every bit change during unlink

Hi,

This is another performance enhancement to speed up clustered unlinks. Functions __gfs2_free_data and __gfs2_free_meta were outputting the rgrp and attaching it to the journal transaction every call. This patch adds a new rlist function gfs2_rlist_out to similarly output all the rgrps in an rlist, and this function is called by do_strip after all the bits have been changed. This is all done under the same transaction so there should be no risk of corruption. Similar functions gfs2_free_data and gfs2_free_meta now fetch the rgrp from the helper functions and output the rgrp.

Regards,

Bob Peterson
Red Hat File Systems

--

fs/gfs2/bmap.c +1 -0
index ef3dc4b..5076896 100644
@@ -876,6 +876,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,
 		btotal += blen;
 	}
 
+	gfs2_rlist_out(&rlist);
 	gfs2_statfs_change(sdp, 0, +btotal, 0);
 	gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid,
 			  ip->i_inode.i_gid);
fs/gfs2/rgrp.c +44 -20

113 lines not on this page · raw message

fs/gfs2/rgrp.h +5 -2
index a80e303..a3819da 100644
@@ -52,9 +52,11 @@ extern int gfs2_ri_update(struct gfs2_inode *ip);
 extern int gfs2_alloc_block(struct gfs2_inode *ip, u64 *bn, unsigned int *n);
 extern int gfs2_alloc_di(struct gfs2_inode *ip, u64 *bn, u64 *generation);
 
-extern void __gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen);
+extern struct gfs2_rgrpd *__gfs2_free_data(struct gfs2_inode *ip, u64 bstart,
+					   u32 blen);
 extern void gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen);
-extern void __gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen);
+extern struct gfs2_rgrpd *__gfs2_free_meta(struct gfs2_inode *ip, u64 bstart,
+					   u32 blen);
 extern void gfs2_free_meta(struct gfs2_inode *ip, u64 bstart, u32 blen);
 extern void gfs2_free_di(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip);
 extern void gfs2_unlink_di(struct inode *inode);
@@ -72,6 +74,7 @@ extern void gfs2_rlist_add(struct gfs2_sbd *sdp, struct gfs2_rgrp_list *rlist,
 			   u64 block);
 extern void gfs2_rlist_alloc(struct gfs2_rgrp_list *rlist, unsigned int state);
 extern void gfs2_rlist_free(struct gfs2_rgrp_list *rlist);
+extern void gfs2_rlist_out(struct gfs2_rgrp_list *rlist);
 extern u64 gfs2_ri_total(struct gfs2_sbd *sdp);
 extern int gfs2_rgrp_dump(struct seq_file *seq, const struct gfs2_glock *gl);