From 4328a550eb342f9e5fd0859305ed5e5afde5ba30 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 11 Feb 2011 15:54:18 -0800 Subject: [PATCH] MDCache: add max_dir_commit_size. Configured by setting mds_dir_max_commit_size in conf, or else by looking at osd_max_write_size. This should lead to sane max commits even if the user doesn't specify anything. This will be used in the next commit or to by CDir. Signed-off-by: Greg Farnum --- src/config.cc | 1 + src/config.h | 1 + src/mds/MDCache.cc | 4 ++++ src/mds/MDCache.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/config.cc b/src/config.cc index 0d593854bd438..9dea8f2403951 100644 --- a/src/config.cc +++ b/src/config.cc @@ -356,6 +356,7 @@ static struct config_option config_optionsp[] = { OPTION(mds_cache_mid, 0, OPT_FLOAT, .7), OPTION(mds_mem_max, 0, OPT_INT, 1048576), // KB OPTION(mds_dir_commit_ratio, 0, OPT_FLOAT, .5), + OPTION(mds_dir_max_commit_size, 0, OPT_INT, 90), // MB OPTION(mds_decay_halflife, 0, OPT_FLOAT, 5), OPTION(mds_beacon_interval, 0, OPT_FLOAT, 4), OPTION(mds_beacon_grace, 0, OPT_FLOAT, 15), diff --git a/src/config.h b/src/config.h index 29b1c3120745e..97c906fed1716 100644 --- a/src/config.h +++ b/src/config.h @@ -234,6 +234,7 @@ struct md_config_t { float mds_cache_mid; int mds_mem_max; float mds_dir_commit_ratio; + int mds_dir_max_commit_size; float mds_decay_halflife; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 2976fbc49d0c4..91153519366de 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -128,6 +128,10 @@ MDCache::MDCache(MDS *m) num_inodes_with_caps = 0; num_caps = 0; + max_dir_commit_size = g_conf.mds_dir_max_commit_size ? + (g_conf.mds_dir_max_commit_size << 20) : + (0.9 *(g_conf.osd_max_write_size << 20)); + discover_last_tid = 0; last_cap_id = 0; diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 54fbcdca89437..b1d557a7d886a 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -453,6 +453,8 @@ public: int num_inodes_with_caps; int num_caps; + unsigned max_dir_commit_size; + ceph_file_layout default_file_layout; ceph_file_layout default_log_layout; -- 2.39.5