aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/bitmap.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2006-10-01 02:28:45 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:28 -0400
commit9ea0f9499d15c49df23e7aac4332d830c40e12d0 (patch)
treee6a68575b3aa3a6ee0db0acf1c6469c0308bf0a7 /fs/reiserfs/bitmap.c
parent5a2618e6a972f305496daa257a56a09dd3acca29 (diff)
[PATCH] reiserfs: eliminate minimum window size for bitmap searching
When a file system becomes fragmented (using MythTV, for example), the bigalloc window searching ends up causing huge performance problems. In a file system presented by a user experiencing this bug, the file system was 90% free, but no 32-block free windows existed on the entire file system. This causes the allocator to scan the entire file system for each 128k write before backing down to searching for individual blocks. In the end, finding a contiguous window for all the blocks in a write is an advantageous special case, but one that can be found naturally when such a window exists anyway. This patch removes the bigalloc window searching, and has been proven to fix the test case described above. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs/bitmap.c')
-rw-r--r--fs/reiserfs/bitmap.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index cca1dbf5458f..1bfae42117ca 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -1034,7 +1034,6 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1034 b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1; 1034 b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1;
1035 int passno = 0; 1035 int passno = 0;
1036 int nr_allocated = 0; 1036 int nr_allocated = 0;
1037 int bigalloc = 0;
1038 1037
1039 determine_prealloc_size(hint); 1038 determine_prealloc_size(hint);
1040 if (!hint->formatted_node) { 1039 if (!hint->formatted_node) {
@@ -1061,28 +1060,9 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1061 hint->preallocate = hint->prealloc_size = 0; 1060 hint->preallocate = hint->prealloc_size = 0;
1062 } 1061 }
1063 /* for unformatted nodes, force large allocations */ 1062 /* for unformatted nodes, force large allocations */
1064 bigalloc = amount_needed;
1065 } 1063 }
1066 1064
1067 do { 1065 do {
1068 /* in bigalloc mode, nr_allocated should stay zero until
1069 * the entire allocation is filled
1070 */
1071 if (unlikely(bigalloc && nr_allocated)) {
1072 reiserfs_warning(s, "bigalloc is %d, nr_allocated %d\n",
1073 bigalloc, nr_allocated);
1074 /* reset things to a sane value */
1075 bigalloc = amount_needed - nr_allocated;
1076 }
1077 /*
1078 * try pass 0 and pass 1 looking for a nice big
1079 * contiguous allocation. Then reset and look
1080 * for anything you can find.
1081 */
1082 if (passno == 2 && bigalloc) {
1083 passno = 0;
1084 bigalloc = 0;
1085 }
1086 switch (passno++) { 1066 switch (passno++) {
1087 case 0: /* Search from hint->search_start to end of disk */ 1067 case 0: /* Search from hint->search_start to end of disk */
1088 start = hint->search_start; 1068 start = hint->search_start;
@@ -1120,8 +1100,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
1120 new_blocknrs + 1100 new_blocknrs +
1121 nr_allocated, 1101 nr_allocated,
1122 start, finish, 1102 start, finish,
1123 bigalloc ? 1103 1,
1124 bigalloc : 1,
1125 amount_needed - 1104 amount_needed -
1126 nr_allocated, 1105 nr_allocated,
1127 hint-> 1106 hint->