From: Ronen Friedman Date: Thu, 21 Sep 2023 09:57:30 +0000 (-0500) Subject: osd/scrub: scheduler refactoring - cleanups X-Git-Tag: v19.0.0~438^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=693cdf3565d90bfc9168e624314a812919167d02;p=ceph-ci.git osd/scrub: scheduler refactoring - cleanups Signed-off-by: Ronen Friedman --- diff --git a/src/osd/scrubber/osd_scrub.cc b/src/osd/scrubber/osd_scrub.cc index 994a60f0b9a..1d1e9eb2fe8 100644 --- a/src/osd/scrubber/osd_scrub.cc +++ b/src/osd/scrubber/osd_scrub.cc @@ -35,7 +35,7 @@ OsdScrub::OsdScrub( , conf{config} , m_resource_bookkeeper{[this](std::string msg) { log_fwd(msg); }, conf} , m_queue{cct, m_osd_svc} - , m_log_prefix{fmt::format("osd.{}: osd-scrub:", m_osd_svc.get_nodeid())} + , m_log_prefix{fmt::format("osd.{} osd-scrub:", m_osd_svc.get_nodeid())} , m_load_tracker{cct, conf, m_osd_svc.get_nodeid()} {} @@ -321,7 +321,7 @@ bool OsdScrub::LoadTracker::scrub_load_below_threshold() const { double loadavgs[3]; if (getloadavg(loadavgs, 3) != 3) { - dout(10) << fmt::format("{}: couldn't read loadavgs", __func__) << dendl; + dout(10) << "couldn't read loadavgs" << dendl; return false; } @@ -398,7 +398,7 @@ bool OsdScrub::scrub_time_permit(utime_t now) const bool time_permits = isbetween_modulo( conf->osd_scrub_begin_hour, conf->osd_scrub_end_hour, bdt.tm_hour); dout(20) << fmt::format( - "{}: should run between {} - {} now {} = {}", __func__, + "should run between {} - {} now {} = {}", conf->osd_scrub_begin_hour, conf->osd_scrub_end_hour, bdt.tm_hour, (time_permits ? "yes" : "no")) << dendl; diff --git a/src/osd/scrubber/osd_scrub_sched.cc b/src/osd/scrubber/osd_scrub_sched.cc index 67933e465a3..5378864f120 100644 --- a/src/osd/scrubber/osd_scrub_sched.cc +++ b/src/osd/scrubber/osd_scrub_sched.cc @@ -477,6 +477,8 @@ ScrubQContainer ScrubQueue::list_registered_jobs() const return all_jobs; } +// ////////////////////////////////////////////////////////////////////////// // +// ScrubQueue - maintaining the 'blocked on a locked object' count void ScrubQueue::clear_pg_scrub_blocked(spg_t blocked_pg) { diff --git a/src/osd/scrubber/osd_scrub_sched.h b/src/osd/scrubber/osd_scrub_sched.h index 1c73fd6364a..a2a19f084f1 100644 --- a/src/osd/scrubber/osd_scrub_sched.h +++ b/src/osd/scrubber/osd_scrub_sched.h @@ -335,6 +335,13 @@ class ScrubQueue { */ std::atomic_int_fast16_t blocked_scrubs_cnt{0}; + /** + * One of the OSD's primary PGs is in the initial phase of a scrub, + * trying to secure its replicas' resources. We will refrain from initiating + * any other scrub sessions until this one is done. + * + * \todo keep the ID of the reserving PG; possibly also the time it started. + */ std::atomic_bool a_pg_is_reserving{false}; /**