cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: Reset rd_last_alloc when it reaches the end of the rgrp
@ 2012-12-20 18:23 Bob Peterson
  2012-12-21  9:40 ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2012-12-20 18:23 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

In function rg_mblk_search, it's searching for multiple blocks in
a given state (e.g. "free"). If there's an active block reservation
its goal is the next free block of that. If the resource group
contains the dinode's goal block, that's used for the search. But
if neither is the case, it uses the rgrp's last allocated block.
That way, consecutive allocations appear after one another on media.
The problem comes in when you hit the end of the rgrp; it would never
start over and search from the beginning. This became a problem,
since if you deleted all the files and data from the rgrp, it would
never start over and find free blocks. So it had to keep searching
further out on the media to allocate blocks. This patch resets the
rd_last_alloc after it does an unsuccessful search at the end of
the rgrp.

Regards,

Bob Peterson
Red Hat File Systems

Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
---
 fs/gfs2/rgrp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index db2c423..7e668e0 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1428,6 +1428,9 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,
 		rs->rs_free = extlen;
 		rs->rs_inum = ip->i_no_addr;
 		rs_insert(ip);
+	} else {
+		if (goal == rgd->rd_last_alloc + rgd->rd_data0)
+			rgd->rd_last_alloc = 0;
 	}
 }
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [GFS2 PATCH] GFS2: Reset rd_last_alloc when it reaches the end of the rgrp
  2012-12-20 18:23 [Cluster-devel] [GFS2 PATCH] GFS2: Reset rd_last_alloc when it reaches the end of the rgrp Bob Peterson
@ 2012-12-21  9:40 ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2012-12-21  9:40 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Both patches are now queued for the -nmw tree. Thanks,

Steve.

On Thu, 2012-12-20 at 13:23 -0500, Bob Peterson wrote:
> Hi,
> 
> In function rg_mblk_search, it's searching for multiple blocks in
> a given state (e.g. "free"). If there's an active block reservation
> its goal is the next free block of that. If the resource group
> contains the dinode's goal block, that's used for the search. But
> if neither is the case, it uses the rgrp's last allocated block.
> That way, consecutive allocations appear after one another on media.
> The problem comes in when you hit the end of the rgrp; it would never
> start over and search from the beginning. This became a problem,
> since if you deleted all the files and data from the rgrp, it would
> never start over and find free blocks. So it had to keep searching
> further out on the media to allocate blocks. This patch resets the
> rd_last_alloc after it does an unsuccessful search at the end of
> the rgrp.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> ---
>  fs/gfs2/rgrp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index db2c423..7e668e0 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -1428,6 +1428,9 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,
>  		rs->rs_free = extlen;
>  		rs->rs_inum = ip->i_no_addr;
>  		rs_insert(ip);
> +	} else {
> +		if (goal == rgd->rd_last_alloc + rgd->rd_data0)
> +			rgd->rd_last_alloc = 0;
>  	}
>  }
>  
> 




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-21  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20 18:23 [Cluster-devel] [GFS2 PATCH] GFS2: Reset rd_last_alloc when it reaches the end of the rgrp Bob Peterson
2012-12-21  9:40 ` Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).