]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
crimson/os/seastore: make segment cleaner do gc based on gc benefit cost ratio 43474/head
authorXuehan Xu <xxhdx1985126@gmail.com>
Tue, 28 Sep 2021 09:35:30 +0000 (17:35 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Mon, 7 Mar 2022 03:44:16 +0000 (11:44 +0800)
commitb8257b432df021a9bd3fb2e2f56168103ba09596
treee54e4a031c4ec60fadcabbf06c29ef43cfd74ea0
parente48fc34b027eedfe2b6ca535d5b6454d73504f8c
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 <xxhdx1985126@gmail.com>
src/crimson/os/seastore/segment_cleaner.h