diff options
author | Mark Fasheh <mfasheh@suse.com> | 2010-04-05 21:17:15 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-05-05 21:18:07 -0400 |
commit | b07f8f24dfe54da0f074b78949044842e8df881f (patch) | |
tree | 8cc24b0a1e02a9b7f1241fbfecca50ac6881b938 /fs/ocfs2 | |
parent | 6b82021b9e91cd689fdffadbcdb9a42597bbe764 (diff) |
ocfs2: change default reservation window sizes
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/reservations.c | 7 | ||||
-rw-r--r-- | fs/ocfs2/reservations.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/fs/ocfs2/reservations.c b/fs/ocfs2/reservations.c index 7fc6cfee95f1..87fa35791f18 100644 --- a/fs/ocfs2/reservations.c +++ b/fs/ocfs2/reservations.c | |||
@@ -55,9 +55,10 @@ static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap, | |||
55 | if (!(resv->r_flags & OCFS2_RESV_FLAG_DIR)) { | 55 | if (!(resv->r_flags & OCFS2_RESV_FLAG_DIR)) { |
56 | /* 8, 16, 32, 64, 128, 256, 512, 1024 */ | 56 | /* 8, 16, 32, 64, 128, 256, 512, 1024 */ |
57 | bits = 4 << osb->osb_resv_level; | 57 | bits = 4 << osb->osb_resv_level; |
58 | } else | 58 | } else { |
59 | bits = OCFS2_RESV_DIR_WINDOW_BITS; | 59 | /* For now, treat directories the same as files. */ |
60 | 60 | bits = 4 << osb->osb_resv_level; | |
61 | } | ||
61 | return bits; | 62 | return bits; |
62 | } | 63 | } |
63 | 64 | ||
diff --git a/fs/ocfs2/reservations.h b/fs/ocfs2/reservations.h index 34bb308375c5..022aff601e15 100644 --- a/fs/ocfs2/reservations.h +++ b/fs/ocfs2/reservations.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/rbtree.h> | 23 | #include <linux/rbtree.h> |
24 | 24 | ||
25 | #define OCFS2_DEFAULT_RESV_LEVEL 4 | 25 | #define OCFS2_DEFAULT_RESV_LEVEL 2 |
26 | #define OCFS2_MAX_RESV_LEVEL 9 | 26 | #define OCFS2_MAX_RESV_LEVEL 9 |
27 | #define OCFS2_MIN_RESV_LEVEL 0 | 27 | #define OCFS2_MIN_RESV_LEVEL 0 |
28 | 28 | ||