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] [PATCH 04/15] GFS2: If we use up our block reservation, request more next time
Date: Mon,  8 Dec 2014 12:38:12 +0000	[thread overview]
Message-ID: <1418042303-1536-5-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1418042303-1536-1-git-send-email-swhiteho@redhat.com>

From: Bob Peterson <rpeterso@redhat.com>

If we run out of blocks for a given multi-block allocation, we obviously
did not reserve enough. We should reserve more blocks for the next
reservation to reduce fragmentation. This patch increases the size hint
for reservations when they run out.

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

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index f4e4a0c..9150207 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2251,6 +2251,9 @@ static void gfs2_adjust_reservation(struct gfs2_inode *ip,
 			trace_gfs2_rs(rs, TRACE_RS_CLAIM);
 			if (rs->rs_free && !ret)
 				goto out;
+			/* We used up our block reservation, so we should
+			   reserve more blocks next time. */
+			atomic_add(RGRP_RSRV_ADDBLKS, &rs->rs_sizehint);
 		}
 		__rs_deltree(rs);
 	}
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 5d8f085..b104f4a 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -20,6 +20,7 @@
  */
 #define RGRP_RSRV_MINBYTES 8
 #define RGRP_RSRV_MINBLKS ((u32)(RGRP_RSRV_MINBYTES * GFS2_NBBY))
+#define RGRP_RSRV_ADDBLKS 64
 
 struct gfs2_rgrpd;
 struct gfs2_sbd;
-- 
1.8.3.1



  parent reply	other threads:[~2014-12-08 12:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 12:38 [Cluster-devel] GFS2: Pre-pull patch posting (merge window) Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 01/15] GFS2: directly return gfs2_dir_check() Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 02/15] GFS2: Set of distributed preferences for rgrps Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 03/15] GFS2: Only increase rs_sizehint Steven Whitehouse
2014-12-08 12:38 ` Steven Whitehouse [this message]
2014-12-08 12:38 ` [Cluster-devel] [PATCH 05/15] GFS2: Use inode_newsize_ok and get_write_access in fallocate Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 06/15] GFS2: Update i_size properly on fallocate Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 07/15] GFS2: Update timestamps " Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 08/15] fs: add freeze_super/thaw_super fs hooks Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 09/15] GFS2: update freeze code to use freeze/thaw_super on all nodes Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 10/15] GFS2: Deletion of unnecessary checks before two function calls Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 11/15] GFS2: bugger off early if O_CREAT open finds a directory Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 12/15] GFS2: gfs2_create_inode(): don't bother with d_splice_alias() Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 13/15] GFS2: use kvfree() instead of open-coding it Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 14/15] GFS2: gfs2_dir_get_hash_table(): avoiding deferred vfree() is easy here Steven Whitehouse
2014-12-08 12:38 ` [Cluster-devel] [PATCH 15/15] GFS2: gfs2_atomic_open(): simplify the use of finish_no_open() Steven Whitehouse

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=1418042303-1536-5-git-send-email-swhiteho@redhat.com \
    --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).