subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1590986 - /subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
Date Tue, 29 Apr 2014 14:11:41 GMT
Author: stefan2
Date: Tue Apr 29 14:11:40 2014
New Revision: 1590986

URL: http://svn.apache.org/r1590986
Log:
Avoid membuffer cache thrashing by large objects, e.g. large fulltexts.
Only very critical information shall go into cache even if the object
is larger than the whole L1.

This has become an issue since we elevated fulltexts from low prio to
default caching prio.

* subversion/libsvn_subr/cache-membuffer.c
  (select_level,
   svn_membuffer_cache_is_cachable): Allow only higher prio items to skip
                                     L1 and go directly into the larger L2
                                     (evicting everything in their wake).

Modified:
    subversion/trunk/subversion/libsvn_subr/cache-membuffer.c

Modified: subversion/trunk/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache-membuffer.c?rev=1590986&r1=1590985&r2=1590986&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache-membuffer.c Tue Apr 29 14:11:40 2014
@@ -1843,9 +1843,9 @@ select_level(svn_membuffer_t *cache,
     }
   else if (   cache->l2.size >= size
            && MAX_ITEM_SIZE >= size
-           && priority >= SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY)
+           && priority > SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY)
     {
-      /* Large and somewhat important items go into L2. */
+      /* Large but important items go into L2. */
       entry_t dummy_entry = { { 0 } };
       dummy_entry.priority = priority;
       dummy_entry.size = (apr_uint32_t) size;
@@ -2809,7 +2809,7 @@ svn_membuffer_cache_is_cachable(void *ca
    * must be small enough to be stored in a 32 bit value.
    */
   svn_membuffer_cache_t *cache = cache_void;
-  return cache->priority >= SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY
+  return cache->priority > SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY
        ? cache->membuffer->l2.size >= size && MAX_ITEM_SIZE >= size
        : size <= cache->membuffer->max_entry_size;
 }



Mime
View raw message