]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: queue null events without PG lock
authorSage Weil <sage@redhat.com>
Wed, 20 Dec 2017 12:55:43 +0000 (06:55 -0600)
committerSage Weil <sage@redhat.com>
Tue, 3 Apr 2018 15:12:35 +0000 (10:12 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/PG.h
src/osd/PGPeeringEvent.h

index 8e009c6f7ef7e8bc5170d2fdefea22470228b195..2df4556ceb76231ce642b0225458d7a2a0a26748 100644 (file)
@@ -4077,7 +4077,7 @@ int OSD::handle_pg_peering_evt(
     }
 
     const bool is_mon_create =
-      evt->get_event().dynamic_type() == PG::NullEvt::static_type();
+      evt->get_event().dynamic_type() == NullEvt::static_type();
     if (maybe_wait_for_max_pg(pgid, is_mon_create)) {
       return -EAGAIN;
     }
@@ -7997,13 +7997,13 @@ void OSD::consume_map()
     for (ceph::unordered_map<spg_t,PG*>::iterator it = pg_map.begin();
         it != pg_map.end();
         ++it) {
-      PG *pg = it->second;
-      if (pg->is_deleted()) {
-       continue;
-      }
-      pg->lock();
-      pg->queue_null(osdmap->get_epoch(), osdmap->get_epoch());
-      pg->unlock();
+      enqueue_peering_evt(
+       it->first,
+       PGPeeringEventRef(
+         std::make_shared<PGPeeringEvent>(
+           osdmap->get_epoch(),
+           osdmap->get_epoch(),
+           NullEvt())));
     }
 
     logger->set(l_osd_pg, pg_map.size());
@@ -8291,10 +8291,10 @@ void OSD::handle_pg_create(OpRequestRef op)
           pi,
           osdmap->get_epoch(),
           PGPeeringEventRef(
-           new PGPeeringEvent(
+           std::make_shared<PGPeeringEvent>(
              osdmap->get_epoch(),
              osdmap->get_epoch(),
-             PG::NullEvt()))
+             NullEvt()))
           ) == -EEXIST) {
       service.send_pg_created(pgid.pgid);
     }
index b516a9a7eaffd432f589b08c92ae1ea0caa59156..7518342a5feb6d4f663f4c4c345123fa94b41668 100644 (file)
@@ -1854,9 +1854,6 @@ protected:
   TrivialEvent(Load)
   TrivialEvent(GotInfo)
   TrivialEvent(NeedUpThru)
-  public:
-  TrivialEvent(NullEvt)
-  protected:
   TrivialEvent(Backfilled)
   TrivialEvent(LocalBackfillReserved)
   TrivialEvent(RejectRemoteReservation)
index 1ecb7691efdc176da52266417ca47e21967009e4..597da5b729d6511c8a3b539b91f0b482958dacf0 100644 (file)
@@ -131,6 +131,7 @@ struct RequestRecoveryPrio : boost::statechart::event< RequestRecoveryPrio > {
     }                                                             \
   };
 
+TrivialEvent(NullEvt)
 TrivialEvent(RemoteBackfillReserved)
 TrivialEvent(RemoteReservationRejected)
 TrivialEvent(RemoteReservationRevokedTooFull)