]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ocfs2: change default reservation window sizes
authorMark Fasheh <mfasheh@suse.com>
Tue, 6 Apr 2010 01:17:15 +0000 (18:17 -0700)
committerJoel Becker <joel.becker@oracle.com>
Thu, 6 May 2010 01:18:07 +0000 (18:18 -0700)
The default reservation size of 4 (32-bit windows) is a bit too ambitious.
Scale it back to 16 bits (resv_level=2). I have been testing various sizes
on a 4-node cluster which runs a mixed workload that is heavily threaded.
With a 256MB local alloc, I get *roughly* the following levels of average file
fragmentation:

resv_level=0 70%
resv_level=1 21%
resv_level=2 23%
resv_level=3 24%
resv_level=4 60%
resv_level=5 did not test
resv_level=6 60%

resv_level=2 seemed like a good compromise between not letting windows be
too small, but not so big that heavier workloads will immediately suffer
without tuning.

This patch also change the behavior of directory reservations - they now
track file reservations.  The previous compromise of giving directory
windows only 8 bits wound up fragmenting more at some window sizes because
file allocations had smaller unused windows to poach from.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Documentation/filesystems/ocfs2.txt
fs/ocfs2/reservations.c
fs/ocfs2/reservations.h

index 412df90959376ae378a5de27e649834a4eff7bb1..32339e584a9a136284baea04b5ac613e22ce43e0 100644 (file)
@@ -80,6 +80,6 @@ user_xattr    (*)     Enables Extended User Attributes.
 nouser_xattr           Disables Extended User Attributes.
 acl                    Enables POSIX Access Control Lists support.
 noacl          (*)     Disables POSIX Access Control Lists support.
-resv_level=4   (*)     Set how agressive allocation reservations will be.
+resv_level=2   (*)     Set how agressive allocation reservations will be.
                        Valid values are between 0 (reservations off) to 8
                        (maximum space for reservations).
index 7fc6cfee95f1567a6fa2330ed9e60f65399af0a7..87fa35791f184700b01ef0f18a8bd0e1b7ed5917 100644 (file)
@@ -55,9 +55,10 @@ static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap,
        if (!(resv->r_flags & OCFS2_RESV_FLAG_DIR)) {
                /* 8, 16, 32, 64, 128, 256, 512, 1024 */
                bits = 4 << osb->osb_resv_level;
-       } else
-               bits = OCFS2_RESV_DIR_WINDOW_BITS;
-
+       } else {
+               /* For now, treat directories the same as files. */
+               bits = 4 << osb->osb_resv_level;
+       }
        return bits;
 }
 
index 34bb308375c5ae987d52b93af9d71dae68228cc3..022aff601e15e14f3c04f625651814ea2644d360 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <linux/rbtree.h>
 
-#define OCFS2_DEFAULT_RESV_LEVEL       4
+#define OCFS2_DEFAULT_RESV_LEVEL       2
 #define OCFS2_MAX_RESV_LEVEL   9
 #define OCFS2_MIN_RESV_LEVEL   0