* [Cluster-devel] [GFS2 Patch] GFS2: speed up delete/unlink performance for large files
@ 2011-09-15 13:59 Bob Peterson
2011-09-15 16:20 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2011-09-15 13:59 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
This patch improves the performance of delete/unlink
operations in a GFS2 file system where the files are large
by adding a layer of metadata read-ahead for indirect blocks.
Mileage will vary, but on my system, deleting an 8.6G file
dropped from 22 seconds to about 4.5 seconds.
Regards,
Bob Peterson
Red Hat File Systems
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
--
fs/gfs2/bmap.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 7878c47..7efa38c 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -691,7 +691,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
{
struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
struct buffer_head *bh = NULL;
- __be64 *top, *bottom;
+ __be64 *top, *bottom, *t2;
u64 bn;
int error;
int mh_size = sizeof(struct gfs2_meta_header);
@@ -719,7 +719,27 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
if (error)
goto out;
- if (height < ip->i_height - 1)
+ if (height < ip->i_height - 1) {
+ struct buffer_head *rabh;
+
+ for (t2 = top; t2 < bottom; t2++, first = 0) {
+ if (!*t2)
+ continue;
+
+ bn = be64_to_cpu(*t2);
+ rabh = gfs2_getbuf(ip->i_gl, bn, CREATE);
+ if (trylock_buffer(rabh)) {
+ if (buffer_uptodate(rabh)) {
+ unlock_buffer(rabh);
+ brelse(rabh);
+ continue;
+ }
+ rabh->b_end_io = end_buffer_read_sync;
+ submit_bh(READA | REQ_META, rabh);
+ continue;
+ }
+ brelse(rabh);
+ }
for (; top < bottom; top++, first = 0) {
if (!*top)
continue;
@@ -731,7 +751,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
if (error)
break;
}
-
+ }
out:
brelse(bh);
return error;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 Patch] GFS2: speed up delete/unlink performance for large files
2011-09-15 13:59 [Cluster-devel] [GFS2 Patch] GFS2: speed up delete/unlink performance for large files Bob Peterson
@ 2011-09-15 16:20 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2011-09-15 16:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Now in the -nmw git tree. Many thanks for this - it looks really good
and will make a big difference to deallocation performance,
Steve.
On Thu, 2011-09-15 at 09:59 -0400, Bob Peterson wrote:
> Hi,
>
> This patch improves the performance of delete/unlink
> operations in a GFS2 file system where the files are large
> by adding a layer of metadata read-ahead for indirect blocks.
> Mileage will vary, but on my system, deleting an 8.6G file
> dropped from 22 seconds to about 4.5 seconds.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> --
> fs/gfs2/bmap.c | 26 +++++++++++++++++++++++---
> 1 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
> index 7878c47..7efa38c 100644
> --- a/fs/gfs2/bmap.c
> +++ b/fs/gfs2/bmap.c
> @@ -691,7 +691,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
> {
> struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
> struct buffer_head *bh = NULL;
> - __be64 *top, *bottom;
> + __be64 *top, *bottom, *t2;
> u64 bn;
> int error;
> int mh_size = sizeof(struct gfs2_meta_header);
> @@ -719,7 +719,27 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
> if (error)
> goto out;
>
> - if (height < ip->i_height - 1)
> + if (height < ip->i_height - 1) {
> + struct buffer_head *rabh;
> +
> + for (t2 = top; t2 < bottom; t2++, first = 0) {
> + if (!*t2)
> + continue;
> +
> + bn = be64_to_cpu(*t2);
> + rabh = gfs2_getbuf(ip->i_gl, bn, CREATE);
> + if (trylock_buffer(rabh)) {
> + if (buffer_uptodate(rabh)) {
> + unlock_buffer(rabh);
> + brelse(rabh);
> + continue;
> + }
> + rabh->b_end_io = end_buffer_read_sync;
> + submit_bh(READA | REQ_META, rabh);
> + continue;
> + }
> + brelse(rabh);
> + }
> for (; top < bottom; top++, first = 0) {
> if (!*top)
> continue;
> @@ -731,7 +751,7 @@ static int recursive_scan(struct gfs2_inode *ip, struct buffer_head *dibh,
> if (error)
> break;
> }
> -
> + }
> out:
> brelse(bh);
> return error;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-15 16:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-15 13:59 [Cluster-devel] [GFS2 Patch] GFS2: speed up delete/unlink performance for large files Bob Peterson
2011-09-15 16:20 ` 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).