]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: move updating of had_map_since out of loop 10470/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 28 Jul 2016 08:24:17 +0000 (16:24 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 28 Jul 2016 22:22:46 +0000 (06:22 +0800)
The had_map_since always sticks to the timestamp
of the last map we ever updated. So this shall ease
CPU a liitle when the set of maps gets huge.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.cc

index 2a0ebe2ce9c787de18da56c14e728f1a82374160..077c7884d89134706cf9f579edb7a1e1244e5f9d 100644 (file)
@@ -6900,9 +6900,6 @@ void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m)
     }
 
     osdmap = newmap;
-
-    had_map_since = ceph_clock_now(cct);
-
     epoch_t up_epoch;
     epoch_t boot_epoch;
     service.retrieve_epochs(&boot_epoch, &up_epoch, NULL);
@@ -6919,6 +6916,8 @@ void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m)
     }
   }
 
+  had_map_since = ceph_clock_now(cct);
+
   epoch_t _bind_epoch = service.get_bind_epoch();
   if (osdmap->is_up(whoami) &&
       osdmap->get_addr(whoami) == client_messenger->get_myaddr() &&