]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
GFS2: If we use up our block reservation, request more next time
authorBob Peterson <rpeterso@redhat.com>
Wed, 29 Oct 2014 13:02:30 +0000 (08:02 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 3 Nov 2014 19:26:54 +0000 (19:26 +0000)
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>
fs/gfs2/rgrp.c
fs/gfs2/rgrp.h

index f4e4a0c5babe4c239af5f4b0111a65ec2d98af99..9150207f365cdfe8207879415fb816526f8178b3 100644 (file)
@@ -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);
        }
index 5d8f085f7adea18f9acce4ea5ed7f9e15527a7d0..b104f4af3afdb8c2ef2f3c4f938aeca09c3bc912 100644 (file)
@@ -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;