cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Use single-block reservations for directories
Date: Wed, 15 May 2013 11:04:11 +0100	[thread overview]
Message-ID: <1368612251.2732.15.camel@menhir> (raw)
In-Reply-To: <727125292.4568955.1368551069023.JavaMail.root@redhat.com>

Hi,

Now in the -nmw tree. Thanks,

Steve.

On Tue, 2013-05-14 at 13:04 -0400, Bob Peterson wrote:
> Hi,
> 
> This patch changes the multi-block allocation code, such that
> directory inodes only get a single block reserved in the bitmap.
> That way, the bitmaps are more tightly packed together, and there
> are fewer spans of free blocks for in-use block reservations.
> This means it takes less time to find a free span of blocks in the
> bitmap, which speeds things up. This increases the performance of
> some workloads by almost 2X. In Nate's mockup.py script (which does
> (1) create dir, (2) create dir in dir, (3) create file in that dir)
> the test executes in 23 steps rather than 43 steps, a 47%
> performance improvement.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> ---
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index 0c5a575..5232525 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
> @@ -1401,9 +1401,14 @@ static void rg_mblk_search(struct gfs2_rgrpd *rgd, struct gfs2_inode *ip,
>  	u32 extlen;
>  	u32 free_blocks = rgd->rd_free_clone - rgd->rd_reserved;
>  	int ret;
> +	struct inode *inode = &ip->i_inode;
>  
> -	extlen = max_t(u32, atomic_read(&rs->rs_sizehint), requested);
> -	extlen = clamp(extlen, RGRP_RSRV_MINBLKS, free_blocks);
> +	if (S_ISDIR(inode->i_mode))
> +		extlen = 1;
> +	else {
> +		extlen = max_t(u32, atomic_read(&rs->rs_sizehint), requested);
> +		extlen = clamp(extlen, RGRP_RSRV_MINBLKS, free_blocks);
> +	}
>  	if ((rgd->rd_free_clone < rgd->rd_reserved) || (free_blocks < extlen))
>  		return;
>  
> 




      reply	other threads:[~2013-05-15 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <663799659.4557619.1368550895419.JavaMail.root@redhat.com>
2013-05-14 17:04 ` [Cluster-devel] [GFS2 PATCH] GFS2: Use single-block reservations for directories Bob Peterson
2013-05-15 10:04   ` Steven Whitehouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368612251.2732.15.camel@menhir \
    --to=swhiteho@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).