FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-11-2008, 06:44 PM
Bob Peterson
 
Default gfs2_alloc_required performance

Hi,

This is a small I/O performance enhancement to gfs2. (Actually, it is a rework of
an earlier version I got wrong). The idea here is to check if the write extends
past the last block in the file. If so, the function can save itself a lot of
time and trouble because it knows an allocate will be required. Benchmarks like
iozone should see better performance.

Regards,

Bob Peterson
Red Hat GFS

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
--
fs/gfs2/bmap.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 73dfad7..4356cc2 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1224,6 +1224,11 @@ int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
unsigned int shift = sdp->sd_sb.sb_bsize_shift;
lblock = offset >> shift;
lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift;
+ if (lblock_stop > ip->i_di.di_blocks) { /* writing past the
+ last block */
+ *alloc_required = 1;
+ return 0;
+ }
}

for (; lblock < lblock_stop; lblock += extlen) {
 
Old 01-11-2008, 08:06 PM
Steven Whitehouse
 
Default gfs2_alloc_required performance

Hi,

Now in the -nmw git tree,

Steve.

On Fri, 2008-01-11 at 13:44 -0600, Bob Peterson wrote:
> Hi,
>
> This is a small I/O performance enhancement to gfs2. (Actually, it is a rework of
> an earlier version I got wrong). The idea here is to check if the write extends
> past the last block in the file. If so, the function can save itself a lot of
> time and trouble because it knows an allocate will be required. Benchmarks like
> iozone should see better performance.
>
> Regards,
>
> Bob Peterson
> Red Hat GFS
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> --
> fs/gfs2/bmap.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
> index 73dfad7..4356cc2 100644
> --- a/fs/gfs2/bmap.c
> +++ b/fs/gfs2/bmap.c
> @@ -1224,6 +1224,11 @@ int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
> unsigned int shift = sdp->sd_sb.sb_bsize_shift;
> lblock = offset >> shift;
> lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift;
> + if (lblock_stop > ip->i_di.di_blocks) { /* writing past the
> + last block */
> + *alloc_required = 1;
> + return 0;
> + }
> }
>
> for (; lblock < lblock_stop; lblock += extlen) {
>
>
 
Old 01-21-2008, 08:22 AM
 
Default gfs2_alloc_required performance

From: Bob Peterson <rpeterso@redhat.com>

This is a small I/O performance enhancement to gfs2. (Actually, it is a rework of
an earlier version I got wrong). The idea here is to check if the write extends
past the last block in the file. If so, the function can save itself a lot of
time and trouble because it knows an allocate will be required. Benchmarks like
iozone should see better performance.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index 73dfad7..4356cc2 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -1224,6 +1224,11 @@ int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
unsigned int shift = sdp->sd_sb.sb_bsize_shift;
lblock = offset >> shift;
lblock_stop = (offset + len + sdp->sd_sb.sb_bsize - 1) >> shift;
+ if (lblock_stop > ip->i_di.di_blocks) { /* writing past the
+ last block */
+ *alloc_required = 1;
+ return 0;
+ }
}

for (; lblock < lblock_stop; lblock += extlen) {
--
1.5.1.2
 

Thread Tools




All times are GMT. The time now is 10:09 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org