Commit 35bfd4b
ext4: separate stream goal hits from s_bal_goals for better tracking
In ext4_mb_regular_allocator(), after the call to ext4_mb_find_by_goal()
fails to achieve the inode goal, allocation continues with the stream
allocation global goal. Currently, hits for both are combined in
sbi->s_bal_goals, hindering accurate optimization.
This commit separates global goal hits into sbi->s_bal_stream_goals. Since
stream allocation doesn't use ac->ac_g_ex.fe_start, set fe_start to -1.
This prevents stream allocations from being counted in s_bal_goals. Also
clear EXT4_MB_HINT_TRY_GOAL to avoid calling ext4_mb_find_by_goal again.
After adding `stream_goal_hits`, `/proc/fs/ext4/sdx/mb_stats` will show:
mballoc:
reqs: 840347
success: 750992
groups_scanned: 1230506
cr_p2_aligned_stats:
hits: 21531
groups_considered: 411664
extents_scanned: 21531
useless_loops: 0
bad_suggestions: 6
cr_goal_fast_stats:
hits: 111222
groups_considered: 1806728
extents_scanned: 467908
useless_loops: 0
bad_suggestions: 13
cr_best_avail_stats:
hits: 36267
groups_considered: 1817631
extents_scanned: 156143
useless_loops: 0
bad_suggestions: 204
cr_goal_slow_stats:
hits: 106396
groups_considered: 5671710
extents_scanned: 22540056
useless_loops: 123747
cr_any_free_stats:
hits: 138071
groups_considered: 724692
extents_scanned: 23615593
useless_loops: 585
extents_scanned: 46804261
goal_hits: 1307
stream_goal_hits: 236317
len_goal_hits: 155549
2^n_hits: 21531
breaks: 225096
lost: 35062
buddies_generated: 40/40
buddies_time_used: 48004
preallocated: 5962467
discarded: 4847560
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20250714130327.1830534-3-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent e9eec6f commit 35bfd4b
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1646 | 1646 | | |
1647 | 1647 | | |
1648 | 1648 | | |
| 1649 | + | |
1649 | 1650 | | |
1650 | 1651 | | |
1651 | 1652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2849 | 2849 | | |
2850 | 2850 | | |
2851 | 2851 | | |
2852 | | - | |
2853 | 2852 | | |
| 2853 | + | |
| 2854 | + | |
2854 | 2855 | | |
2855 | 2856 | | |
2856 | 2857 | | |
| |||
3000 | 3001 | | |
3001 | 3002 | | |
3002 | 3003 | | |
3003 | | - | |
| 3004 | + | |
3004 | 3005 | | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
3005 | 3010 | | |
3006 | 3011 | | |
3007 | 3012 | | |
| |||
3194 | 3199 | | |
3195 | 3200 | | |
3196 | 3201 | | |
| 3202 | + | |
| 3203 | + | |
3197 | 3204 | | |
3198 | 3205 | | |
3199 | 3206 | | |
| |||
0 commit comments