]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDCache: add max_dir_commit_size.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 11 Feb 2011 23:54:18 +0000 (15:54 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 11 Feb 2011 23:54:18 +0000 (15:54 -0800)
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 <gregory.farnum@dreamhost.com>
src/config.cc
src/config.h
src/mds/MDCache.cc
src/mds/MDCache.h

index 0d593854bd43819e14a343a6f3b9f11babf8a429..9dea8f2403951b904ac273311ddf16c6232cd567 100644 (file)
@@ -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),
index 29b1c3120745e45ff567a4386058e8b3f7308b1c..97c906fed17165e1bf493c6566f52d64014bf5bb 100644 (file)
@@ -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;
 
index 2976fbc49d0c4bb44f6a45d58e05175e192e3623..91153519366deceb3437f18eea0c746ff2ba9c3a 100644 (file)
@@ -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;
index 54fbcdca894376beefb43cb34fab3f6b1bb263e5..b1d557a7d886a71ec118ee46150c870a0cc9f92d 100644 (file)
@@ -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;