Commit fbd5c40
committed
osd: Update PGSnapTrim op queue item cost to reflect average object size
Previously, a static value of snap_trim_cost (1 MiB by default) for
PGSnapTrim item was used (see config option osd_snap_trim_cost). For pools
with significantly different sizes of objects, the static cost doesn't
accurately estimate the amount of IO each snap trim operation requires.
Instead, add a cost_per_object parameter to OSDService::queue_for_snap_trim
and set it to the average object size in the PG being queued by using
PG::get_average_object_size().
In addition, for the mClock scheduler, the cost_per_object is multiplied
by the actual number of object trimmed per iteration. This multiplier is
represented by osd_pg_max_concurrent_snap_trims config option which is
used when the actual work starts (See DoSnapWork).
Note: The above cost calculation is valid for most snap trim
iterations except for:
1. The penultimate iteration which may return only 1 object to be trimmed,
in which case the cost will be off by a factor equivalent to the average
object size.
2. The final iteration (returns -ENOENT), involving clean-ups.
Fixes: https://tracker.ceph.com/issues/63604
Signed-off-by: Sridhar Seshasayee <[email protected]>1 parent 08b2255 commit fbd5c40
3 files changed
+24
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1719 | 1719 | | |
1720 | 1720 | | |
1721 | 1721 | | |
1722 | | - | |
| 1722 | + | |
1723 | 1723 | | |
1724 | 1724 | | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
1725 | 1743 | | |
1726 | 1744 | | |
1727 | 1745 | | |
1728 | 1746 | | |
1729 | | - | |
| 1747 | + | |
1730 | 1748 | | |
1731 | 1749 | | |
1732 | 1750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
502 | | - | |
| 502 | + | |
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15605 | 15605 | | |
15606 | 15606 | | |
15607 | 15607 | | |
| 15608 | + | |
| 15609 | + | |
15608 | 15610 | | |
15609 | | - | |
| 15611 | + | |
15610 | 15612 | | |
15611 | 15613 | | |
15612 | 15614 | | |
| |||
0 commit comments