]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not release recovery_ops_reserved on requeue
authorSage Weil <sage@redhat.com>
Fri, 2 Feb 2018 21:50:25 +0000 (15:50 -0600)
committerSage Weil <sage@redhat.com>
Wed, 4 Apr 2018 13:26:51 +0000 (08:26 -0500)
This doesn't make sense.. although it's the same behavior as
luminous.

The point of the releases here is that if we drop something that is in
the queue we drop the recovery_ops_reserved counter by that much.  However,
if something is in the queue and waiting, and we wake it back up, there
is no net change to _reserved... which is only decremented when we
actually dequeue something.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 303b9f405138a80e7171e10bb013faee4985b24b..8cebc1276de3ab41d7b8d291d8948c8c08d908d9 100644 (file)
@@ -9496,24 +9496,12 @@ int OSD::init_op_flags(OpRequestRef& op)
 void OSD::ShardedOpWQ::_wake_pg_slot(
   spg_t pgid,
   ShardData *sdata,
-  ShardData::pg_slot& slot,
-  unsigned *pushes_to_free)
+  ShardData::pg_slot& slot)
 {
   dout(20) << __func__ << " " << pgid
           << " to_process " << slot.to_process
           << " waiting " << slot.waiting
           << " waiting_peering " << slot.waiting_peering << dendl;
-  for (auto& q : slot.to_process) {
-    *pushes_to_free += q.get_reserved_pushes();
-  }
-  for (auto& q : slot.waiting) {
-    *pushes_to_free += q.get_reserved_pushes();
-  }
-  for (auto& q : slot.waiting_peering) {
-    for (auto& r : q.second) {
-      *pushes_to_free += r.get_reserved_pushes();
-    }
-  }
   for (auto i = slot.to_process.rbegin();
        i != slot.to_process.rend();
        ++i) {
@@ -9545,18 +9533,14 @@ void OSD::ShardedOpWQ::wake_pg_split_waiters(spg_t pgid)
   uint32_t shard_index = pgid.hash_to_shard(shard_list.size());
   auto sdata = shard_list[shard_index];
   bool queued = false;
-  unsigned pushes_to_free = 0;
   {
     Mutex::Locker l(sdata->sdata_op_ordering_lock);
     auto p = sdata->pg_slots.find(pgid);
     if (p != sdata->pg_slots.end()) {
-      _wake_pg_slot(pgid, sdata, p->second, &pushes_to_free);
+      _wake_pg_slot(pgid, sdata, p->second);
       queued = true;
     }
   }
-  if (pushes_to_free > 0) {
-    osd->service.release_reserved_pushes(pushes_to_free);
-  }
   if (queued) {
     sdata->sdata_lock.Lock();
     sdata->sdata_cond.SignalOne();
@@ -9598,7 +9582,7 @@ void OSD::ShardedOpWQ::prune_or_wake_pg_waiters(OSDMapRef osdmap, int whoami)
          dout(20) << __func__ << "  " << p->first
                   << " pending_peering first epoch " << first
                   << " <= " << osdmap->get_epoch() << ", requeueing" << dendl;
-         _wake_pg_slot(p->first, sdata, slot, &pushes_to_free);
+         _wake_pg_slot(p->first, sdata, slot);
          queued = true;
        }
        ++p;
@@ -9864,7 +9848,7 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
            pg = osd->handle_pg_create_info(osdmap, create_info);
            if (pg) {
              // we created the pg! drop out and continue "normally"!
-             _wake_pg_slot(token, sdata, slot, &pushes_to_free);
+             _wake_pg_slot(token, sdata, slot);
              break;
            }
            dout(20) << __func__ << " ignored create on " << qi << dendl;
@@ -9913,6 +9897,9 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb)
       _add_slot_waiter(token, slot, std::move(qi));
       sdata->sdata_op_ordering_lock.Unlock();
       pg->unlock();
+      if (pushes_to_free) {
+       osd->service.release_reserved_pushes(pushes_to_free);
+      }
       return;
     }
   }
index 1734e2dc15ccedfe34337c4ca26372b457e6b0b9..544273b4154b8556642d187adca184047aa2e02f 100644 (file)
@@ -1678,8 +1678,7 @@ private:
     /// wake any pg waiters after a PG is split
     void wake_pg_split_waiters(spg_t pgid);
 
-    void _wake_pg_slot(spg_t pgid, ShardData *sdata, ShardData::pg_slot& slot,
-                      unsigned *pushes_to_free);
+    void _wake_pg_slot(spg_t pgid, ShardData *sdata, ShardData::pg_slot& slot);
 
     /// prime slots for splitting pgs
     void prime_splits(const set<spg_t>& pgs);