Skip to contentSkip to conversation

GFS2: No need to check congested twice

PATCH New Bob Peterson 2 participants 2 messages Jun 30, 2017 – Jul 3, 2017 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): [email protected]

#1 lore raw

PATCH 1/1 GFS2: No need to check congested twice

Hi,

Before this patch, the congestion status for an rgrp glock was checked
twice: Once before acquiring the glock and once afterward. We only need to check it once. Since after we've already acquired the glock is too late to avoid the dlm calls, it makes no sense to do it there. Therefore the redundant check is removed.

---

fs/gfs2/rgrp.c +0 -3
index 836e38b..7c9b6d2 100644
@@ -2003,9 +2003,6 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, struct gfs2_alloc_parms *ap)
 						   &rs->rs_rgd_gh);
 			if (unlikely(error))
 				return error;
-			if (!gfs2_rs_active(rs) && (loops < 2) &&
-			    gfs2_rgrp_congested(rs->rs_rbm.rgd, loops))
-				goto skip_rgrp;
 			if (sdp->sd_args.ar_rgrplvb) {
 				error = update_rgrp_lvb(rs->rs_rbm.rgd);
 				if (unlikely(error)) {
#2 lore raw

PATCH 1/1 GFS2: No need to check congested twice

Hi,

Quoted 9 lines · Bob Peterson

Hi,

Before this patch, the congestion status for an rgrp glock was checked
twice: Once before acquiring the glock and once afterward. We only need to check it once. Since after we've already acquired the glock is too late to avoid the dlm calls, it makes no sense to do it there. Therefore the redundant check is removed.

It isn't redundant. The first check tries to avoid getting the glock, however it may be wrong since until we get the glock, we won't have up to date stats, so thats why we check it again. It may sound odd to wait for the glock and then decide that we are not going to use it, but for the contention case we don't have any other choice at the moment, since we are unable to set a timeout on DLM operations, which would be the ideal case,

Steve.

Quoted 15 lines

---

fs/gfs2/rgrp.c +0 -3
index 836e38b..7c9b6d2 100644
@@ -2003,9 +2003,6 @@ int gfs2_inplace_reserve(struct gfs2_inode *ip, struct gfs2_alloc_parms *ap)
  						   &rs->rs_rgd_gh);
  			if (unlikely(error))
  				return error;
-			if (!gfs2_rs_active(rs) && (loops < 2) &&
-			    gfs2_rgrp_congested(rs->rs_rbm.rgd, loops))
-				goto skip_rgrp;
  			if (sdp->sd_args.ar_rgrplvb) {
  				error = update_rgrp_lvb(rs->rs_rbm.rgd);
  				if (unlikely(error)) {