Commit b8257b4
committed
crimson/os/seastore: make segment cleaner do gc based on gc benefit cost ratio
Segments' benefit cost ratio is calculated:
segment_last_mod_time = max{last modification time of all extents in the segment}
segment_last_rewrite_time = max{last rewrite time of all extents in the segment}
segment_utilization = segment_live_bytes / segment_size
segment_age = current_time - max{segment_last_mod_time, segment_last_rewrite_time}
benefit_cost_ratio = (1 - segment_utilization) * segment_age / (1 + segment_utilization)
Segment cleaner always reclaim the segment with the largest benefit cost ratio
Signed-off-by: Xuehan Xu <[email protected]>1 parent e48fc34 commit b8257b4
1 file changed
+18
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
898 | 909 | | |
899 | 910 | | |
900 | 911 | | |
901 | | - | |
| 912 | + | |
902 | 913 | | |
903 | 914 | | |
904 | 915 | | |
905 | 916 | | |
906 | 917 | | |
| 918 | + | |
907 | 919 | | |
908 | 920 | | |
909 | | - | |
| 921 | + | |
910 | 922 | | |
911 | 923 | | |
912 | | - | |
| 924 | + | |
913 | 925 | | |
914 | 926 | | |
915 | 927 | | |
916 | 928 | | |
917 | | - | |
| 929 | + | |
918 | 930 | | |
919 | | - | |
| 931 | + | |
| 932 | + | |
920 | 933 | | |
921 | 934 | | |
922 | 935 | | |
| |||
0 commit comments