From: xie xingguo Date: Thu, 28 Jul 2016 08:24:17 +0000 (+0800) Subject: osd: move updating of had_map_since out of loop X-Git-Tag: ses5-milestone5~211^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b425c3b8439b796d56ceedee4a16cefa9b624c18;p=ceph.git osd: move updating of had_map_since out of loop 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 2a0ebe2ce9c7..077c7884d891 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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() &&