From b425c3b8439b796d56ceedee4a16cefa9b624c18 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Thu, 28 Jul 2016 16:24:17 +0800 Subject: [PATCH] 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 --- src/osd/OSD.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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() && -- 2.47.3