[Cluster-devel] [GFS2 PATCH] GFS2: No need to check congested twice

Steven Whitehouse swhiteho at redhat.com
Mon Jul 3 09:23:21 UTC 2017


Hi,


On 30/06/17 17:37, Bob Peterson wrote:
> 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.
>
> Signed-off-by: Bob Peterson <rpeterso at redhat.com>
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.

> ---
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index 836e38b..7c9b6d2 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -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)) {




More information about the Cluster-devel mailing list