Commit c84053d
btrfs: update per-profile available estimation
This involves the following timing:
- Chunk allocation
- Chunk removal
- After Mount
- New device
- Device removal
- Device shrink
- Device enlarge
And since the function btrfs_update_per_profile_avail() will not return
an error, this won't cause new error handling path.
Although when btrfs_update_per_profile_avail() failed (only ENOSPC
possible) it will mark the per-profile available estimation as
unreliable, so later btrfs_get_per_profile_avail() will return false and
require the caller to have a fallback solution.
The function btrfs_update_per_profile_avail() will be executed with
chunk_mutex hold, thus it will slightly slow down those involved
functions, but not a lot.
As all the core workload is just various u64 calculations inside a loop,
without any tree search, the overhead should be acceptable even for all
supported 9 profiles.
For 4 disks (which exercises all 9 profiles), the execution time of that
function will still be less than 10 us.
Reviewed-by: Filipe Manana <[email protected]>
Signed-off-by: Qu Wenruo <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent 52fead5 commit c84053d
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2340 | 2340 | | |
2341 | 2341 | | |
2342 | 2342 | | |
| 2343 | + | |
2343 | 2344 | | |
2344 | 2345 | | |
2345 | 2346 | | |
| |||
2451 | 2452 | | |
2452 | 2453 | | |
2453 | 2454 | | |
| 2455 | + | |
2454 | 2456 | | |
2455 | 2457 | | |
2456 | 2458 | | |
| |||
2938 | 2940 | | |
2939 | 2941 | | |
2940 | 2942 | | |
| 2943 | + | |
2941 | 2944 | | |
2942 | 2945 | | |
2943 | 2946 | | |
| |||
2948 | 2951 | | |
2949 | 2952 | | |
2950 | 2953 | | |
| 2954 | + | |
2951 | 2955 | | |
2952 | 2956 | | |
2953 | 2957 | | |
| |||
3030 | 3034 | | |
3031 | 3035 | | |
3032 | 3036 | | |
| 3037 | + | |
3033 | 3038 | | |
3034 | 3039 | | |
3035 | 3040 | | |
| |||
3122 | 3127 | | |
3123 | 3128 | | |
3124 | 3129 | | |
| 3130 | + | |
3125 | 3131 | | |
3126 | 3132 | | |
3127 | 3133 | | |
| |||
3498 | 3504 | | |
3499 | 3505 | | |
3500 | 3506 | | |
| 3507 | + | |
3501 | 3508 | | |
3502 | 3509 | | |
3503 | 3510 | | |
| |||
5201 | 5208 | | |
5202 | 5209 | | |
5203 | 5210 | | |
| 5211 | + | |
5204 | 5212 | | |
5205 | 5213 | | |
5206 | 5214 | | |
| |||
5316 | 5324 | | |
5317 | 5325 | | |
5318 | 5326 | | |
| 5327 | + | |
5319 | 5328 | | |
5320 | 5329 | | |
5321 | 5330 | | |
| |||
6028 | 6037 | | |
6029 | 6038 | | |
6030 | 6039 | | |
| 6040 | + | |
| 6041 | + | |
6031 | 6042 | | |
6032 | 6043 | | |
6033 | 6044 | | |
| |||
8603 | 8614 | | |
8604 | 8615 | | |
8605 | 8616 | | |
8606 | | - | |
| 8617 | + | |
| 8618 | + | |
| 8619 | + | |
| 8620 | + | |
| 8621 | + | |
| 8622 | + | |
| 8623 | + | |
| 8624 | + | |
8607 | 8625 | | |
8608 | 8626 | | |
8609 | 8627 | | |
| |||
0 commit comments