From 7f337a7012c50ac5568401b21868b1b01e8c6cba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Piotr=20Da=C5=82ek?= Date: Thu, 15 Oct 2015 11:46:56 +0200 Subject: [PATCH] osd/PGLog.h: reorder bool fields in PGLog struct MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Move bool fields to the bottom (end) of the struct so they are next to each other. On x86/x64, this change saves 16 bytes per single PGLog struct due to less bytes wasted for field alignment. Signed-off-by: Piotr Dałek --- src/osd/PGLog.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 744f31883e7..fd82a703c8b 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -299,20 +299,20 @@ struct PGLog { protected: //////////////////// data members //////////////////// - bool pg_log_debug; map divergent_priors; pg_missing_t missing; IndexedLog log; - /// Log is clean on [dirty_to, dirty_from) - bool touched_log; eversion_t dirty_to; ///< must clear/writeout all keys <= dirty_to eversion_t dirty_from; ///< must clear/writeout all keys >= dirty_from eversion_t writeout_from; ///< must writout keys >= writeout_from set trimmed; ///< must clear keys in trimmed - bool dirty_divergent_priors; CephContext *cct; + bool pg_log_debug; + /// Log is clean on [dirty_to, dirty_from) + bool touched_log; + bool dirty_divergent_priors; bool is_dirty() const { return !touched_log || @@ -375,10 +375,11 @@ protected: } public: PGLog(CephContext *cct = 0) : + dirty_from(eversion_t::max()), + writeout_from(eversion_t::max()), + cct(cct), pg_log_debug(!(cct && !(cct->_conf->osd_debug_pg_log_writeout))), - touched_log(false), dirty_from(eversion_t::max()), - writeout_from(eversion_t::max()), - dirty_divergent_priors(false), cct(cct) {} + touched_log(false), dirty_divergent_priors(false) {} void reset_backfill(); -- 2.47.3