]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: Update PGSnapTrim op queue item cost to reflect average object size
authorSridhar Seshasayee <sseshasa@redhat.com>
Mon, 20 Nov 2023 13:17:14 +0000 (18:47 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Tue, 2 Jan 2024 07:44:21 +0000 (13:14 +0530)
commit890bb1613d37d3b2edea077e5be83f13de5fa3f9
treecf1c8deac335692c7de297b171f8f95cafc15363
parent01593e714340b2a12e625ac4edb546952f57f326
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 <sseshasa@redhat.com>
(cherry picked from commit fbd5c40edccccbb44b66e9d82fc71b14ac1d04ae)
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PrimaryLogPG.cc