From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH 3/3] GFS2: If we use up our block reservation, request more next time
Date: Wed, 29 Oct 2014 08:02:30 -0500 [thread overview]
Message-ID: <664481dc8f165797571368a8cf2cbe3dbd10c59d.1414587069.git.rpeterso@redhat.com> (raw)
In-Reply-To: <cover.1414587069.git.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.
---
fs/gfs2/rgrp.c | 3 +++
fs/gfs2/rgrp.h | 1 +
2 files changed, 4 insertions(+)
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.9.3
next prev parent reply other threads:[~2014-10-29 13:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 13:02 [Cluster-devel] [GFS2 PATCH 0/3] Patches to reduce GFS2 fragmentation Bob Peterson
2014-10-29 13:02 ` [Cluster-devel] [GFS2 PATCH 1/3] GFS2: Set of distributed preferences for rgrps Bob Peterson
2014-10-29 13:02 ` [Cluster-devel] [GFS2 PATCH 2/3] GFS2: Only increase rs_sizehint Bob Peterson
2014-10-29 13:02 ` Bob Peterson [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-10-24 17:49 [Cluster-devel] [GFS2 PATCH 0/3] Patches to reduce GFS2 fragmentation Bob Peterson
2014-10-24 17:49 ` [Cluster-devel] [GFS2 PATCH 3/3] GFS2: If we use up our block reservation, request more next time Bob Peterson
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=664481dc8f165797571368a8cf2cbe3dbd10c59d.1414587069.git.rpeterso@redhat.com \
--to=rpeterso@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).