Author: stefan2
Date: Sat Apr 19 12:44:07 2014
New Revision: 1588651

URL: http://svn.apache.org/r1588651
Log:
Reduce the size of an FSFS instance by using temporary pools
for temp. data during fs_open().

* subversion/libsvn_fs_fs/fs_fs.h
  (svn_fs_fs__initialize_caches): Document that the POOL shall be
                                  used for temporaries only.

* subversion/libsvn_fs_fs/caching.c
  (svn_fs_fs__initialize_caches): Fix the only place where we used
                                  POOL instead of FS->POOL for
                                  something with svn_fs_t lifetime.

* subversion/libsvn_fs_fs/fs.c
  (fs_serialized_init): Document POOL usage that we will now rely on.
  (fs_open): Use a SUBPOOL for anything temporary during FS init.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/caching.c
    subversion/trunk/subversion/libsvn_fs_fs/fs.c
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h

Modified: subversion/trunk/subversion/libsvn_fs_fs/caching.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/caching.c?rev=1588651&r1=1588650&r2=1588651&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/caching.c Sat Apr 19 12:44:07 2014
@@ -411,11 +411,11 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
 #ifdef SVN_DEBUG_CACHE_DUMP_STATS
 
   /* schedule printing the global access statistics upon pool cleanup,
-    * i.e. end of FSFS session.
-    */
+   * i.e. when the repo instance gets closed / cleaned up.
+   */
   if (membuffer)
-    apr_pool_cleanup_register(pool,
-                              pool,
+    apr_pool_cleanup_register(fs->pool,
+                              fs->pool,
                               dump_global_cache_statistics,
                               apr_pool_cleanup_null);
 #endif

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.c?rev=1588651&r1=1588650&r2=1588651&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.c Sat Apr 19 12:44:07 2014
@@ -56,6 +56,9 @@
 
 
 
+/* Initialize the part of FS that requires global serialization across all
+   instances.  The caller is responsible of ensuring that serialization.
+   Use COMMON_POOL for process-wide and POOL for temporary allocations. */
 static svn_error_t *
 fs_serialized_init(svn_fs_t *fs, apr_pool_t *common_pool, apr_pool_t *pool)
 {
@@ -275,15 +278,19 @@ fs_open(svn_fs_t *fs,
         apr_pool_t *pool,
         apr_pool_t *common_pool)
 {
+  apr_pool_t *subpool = svn_pool_create(pool);
+
   SVN_ERR(svn_fs__check_fs(fs, FALSE));
 
   SVN_ERR(initialize_fs_struct(fs));
 
-  SVN_ERR(svn_fs_fs__open(fs, path, pool));
+  SVN_ERR(svn_fs_fs__open(fs, path, subpool));
 
-  SVN_ERR(svn_fs_fs__initialize_caches(fs, pool));
+  SVN_ERR(svn_fs_fs__initialize_caches(fs, subpool));
   SVN_MUTEX__WITH_LOCK(common_pool_lock,
-                       fs_serialized_init(fs, common_pool, pool));
+                       fs_serialized_init(fs, common_pool, subpool));
+
+  svn_pool_destroy(subpool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h?rev=1588651&r1=1588650&r2=1588651&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.h Sat Apr 19 12:44:07 2014
@@ -218,7 +218,7 @@ svn_fs_fs__get_node_origin(const svn_fs_
 
 
 /* Initialize all session-local caches in FS according to the global
-   cache settings. Use POOL for allocations.
+   cache settings. Use POOL for temporary allocations.
 
    Please note that it is permissible for this function to set some
    or all of these caches to NULL, regardless of any setting. */


Reply via email to