From: Samuel Just Date: Tue, 27 Aug 2013 06:19:45 +0000 (-0700) Subject: PGLog: move the log size check after the early return X-Git-Tag: v0.69~36^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fe68b15a3d82349f8941f5b9f70fcbb5d4bc7f97;p=ceph.git PGLog: move the log size check after the early return There really are stl implementations (like the one on my ubuntu 12.04 machine) which have a list::size() which is linear in the size of the list. That assert, therefore, is quite expensive! Fixes: #6040 Backport: Dumpling Signed-off-by: Samuel Just --- diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 552f9b0cee96..712c1e1c9179 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -205,11 +205,11 @@ protected: log_keys_debug->erase(i++)); } void check() { - assert(log.log.size() == log_keys_debug.size()); if (cct && !(cct->_conf->osd_debug_pg_log_writeout)) { return; } + assert(log.log.size() == log_keys_debug.size()); for (list::iterator i = log.log.begin(); i != log.log.end(); ++i) {