On Mon, 22 Mar 2010 16:03:10 -0600, Andreas Dilger <adilger@sun.com> wrote:
@@ -125,8 +125,7 @@
* list. In case of inode preallocation we follow a list of heuristics
* based on file size. This can be found in ext4_mb_normalize_request. If
* we are doing a group prealloc we try to normalize the request to
- * sbi->s_mb_group_prealloc. Default value of s_mb_group_prealloc is
- * 512 blocks. This can be tuned via
+ * sbi->s_mb_group_prealloc. This can be tuned via
* /sys/fs/ext4/<partition/mb_group_prealloc. The value is represented in
* terms of number of blocks. If we have mounted the file system with -O
* stripe=<value> option the group prealloc request is normalized to the
@@ -2029,9 +2028,12 @@ repeat:
if (group == ngroups)
group = 0;
- /* quick check to skip empty groups */
+ /* If there's no chance that this group has a better
+ * extent, just skip it instead of seeking to read
+ * block bitmap from disk. Initially ac_b_ex.fe_len = 0,
+ * so this always skips groups with no free space. */
grp = ext4_get_group_info(sb, group);
- if (grp->bb_free == 0)
+ if (grp->bb_free <= ac->ac_b_ex.fe_len)
continue;
err = ext4_mb_load_buddy(sb, group, &e4b);
I was wondering whether we need to make sure we also use criteria value
when checking for bb_free. If we are really low on space we may want to
return what is left right ?. Or does ac_b_ex take care of that ?
-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html