Skip to content

Commit 2caffb6

Browse files
Kemeng Shitytso
authored andcommitted
ext4: use correct criteria name instead stale integer number in comment
Use correct criteria name instead stale integer number in comment Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20240424061904.987525-5-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent d1a3924 commit 2caffb6

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

fs/ext4/ext4.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,14 @@ enum criteria {
213213
#define EXT4_MB_USE_RESERVED 0x2000
214214
/* Do strict check for free blocks while retrying block allocation */
215215
#define EXT4_MB_STRICT_CHECK 0x4000
216-
/* Large fragment size list lookup succeeded at least once for cr = 0 */
216+
/* Large fragment size list lookup succeeded at least once for
217+
* CR_POWER2_ALIGNED */
217218
#define EXT4_MB_CR_POWER2_ALIGNED_OPTIMIZED 0x8000
218-
/* Avg fragment size rb tree lookup succeeded at least once for cr = 1 */
219+
/* Avg fragment size rb tree lookup succeeded at least once for
220+
* CR_GOAL_LEN_FAST */
219221
#define EXT4_MB_CR_GOAL_LEN_FAST_OPTIMIZED 0x00010000
220-
/* Avg fragment size rb tree lookup succeeded at least once for cr = 1.5 */
222+
/* Avg fragment size rb tree lookup succeeded at least once for
223+
* CR_BEST_AVAIL_LEN */
221224
#define EXT4_MB_CR_BEST_AVAIL_LEN_OPTIMIZED 0x00020000
222225

223226
struct ext4_allocation_request {

fs/ext4/mballoc.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,8 +1135,9 @@ static void ext4_mb_choose_next_group(struct ext4_allocation_context *ac,
11351135
ext4_mb_choose_next_group_best_avail(ac, new_cr, group);
11361136
} else {
11371137
/*
1138-
* TODO: For CR=2, we can arrange groups in an rb tree sorted by
1139-
* bb_free. But until that happens, we should never come here.
1138+
* TODO: For CR_GOAL_LEN_SLOW, we can arrange groups in an
1139+
* rb tree sorted by bb_free. But until that happens, we should
1140+
* never come here.
11401141
*/
11411142
WARN_ON(1);
11421143
}
@@ -2683,7 +2684,7 @@ static int ext4_mb_good_group_nolock(struct ext4_allocation_context *ac,
26832684
int ret;
26842685

26852686
/*
2686-
* cr=CR_POWER2_ALIGNED/CR_GOAL_LEN_FAST is a very optimistic
2687+
* CR_POWER2_ALIGNED/CR_GOAL_LEN_FAST is a very optimistic
26872688
* search to find large good chunks almost for free. If buddy
26882689
* data is not ready, then this optimization makes no sense. But
26892690
* we never skip the first block group in a flex_bg, since this
@@ -3448,10 +3449,11 @@ static int ext4_mb_init_backend(struct super_block *sb)
34483449
}
34493450
if (sbi->s_mb_prefetch > ext4_get_groups_count(sb))
34503451
sbi->s_mb_prefetch = ext4_get_groups_count(sb);
3451-
/* now many real IOs to prefetch within a single allocation at cr=0
3452-
* given cr=0 is an CPU-related optimization we shouldn't try to
3453-
* load too many groups, at some point we should start to use what
3454-
* we've got in memory.
3452+
/*
3453+
* now many real IOs to prefetch within a single allocation at
3454+
* CR_POWER2_ALIGNED. Given CR_POWER2_ALIGNED is an CPU-related
3455+
* optimization we shouldn't try to load too many groups, at some point
3456+
* we should start to use what we've got in memory.
34553457
* with an average random access time 5ms, it'd take a second to get
34563458
* 200 groups (* N with flex_bg), so let's make this limit 4
34573459
*/

fs/ext4/mballoc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ struct ext4_allocation_context {
187187
struct ext4_free_extent ac_f_ex;
188188

189189
/*
190-
* goal len can change in CR1.5, so save the original len. This is
191-
* used while adjusting the PA window and for accounting.
190+
* goal len can change in CR_BEST_AVAIL_LEN, so save the original len.
191+
* This is used while adjusting the PA window and for accounting.
192192
*/
193193
ext4_grpblk_t ac_orig_goal_len;
194194

0 commit comments

Comments
 (0)