diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2009-01-09 19:53:30 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2009-01-09 19:53:30 (GMT) |
commit | 041e7dbfed0e6787d09cd1ad9f4dfa09b936ec31 (patch) | |
tree | ebc775e7844b267f6217410046a90dd0556162f8 /src/H5Cpkg.h | |
parent | 307f67d52582c2ca9d59acd5b0f53511f0493ad2 (diff) | |
download | hdf5-041e7dbfed0e6787d09cd1ad9f4dfa09b936ec31.zip hdf5-041e7dbfed0e6787d09cd1ad9f4dfa09b936ec31.tar.gz hdf5-041e7dbfed0e6787d09cd1ad9f4dfa09b936ec31.tar.bz2 |
[svn-r16290] Purpose:
Adding code to maintain a min_clean_fraction in the cache in serial mode.
Description:
The metadata cache now has the ability to maintain a min_clean_fraction
when in serial mode. The default initial cache size has been changed
from 1MB to 2MB, and the default min_clean_fraction has been set at 30%.
This check-in includes modifications to H5C.c to support maintaining a
min_clean_size, including the addition of clean_index_size and
dirty_index_size trackers, modifications to the H5C_make_space_in_cache
algorithm, as well as associated test code and additional statistics
tracking variables.
Maintaining the min_clean_fraction addresses the possibility of
experiencing a "metadata blizzard" when the cache gets completely
full with dirty entries. Upon having to make space, the cache would
previously need to flush every single entry in the cache before coming
across a clean entry which could be evicted. This resulted in unnecessary
flushing of oftentimes hot entries in the cache. Maintaining the
min_clean_fraction ensures that, when space is needed, clean entries
are more readily available to evict.
Tested:
jam, smirom, linew (h5committest)
Diffstat (limited to 'src/H5Cpkg.h')
-rw-r--r-- | src/H5Cpkg.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index bdbb25e..5e7b1a7 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -203,6 +203,38 @@ * index_size by two should yield a conservative estimate * of the cache's memory footprint. * + * clean_index_size: Number of bytes of clean entries currently stored in + * the hash table. Note that the index_size field (above) + * is also the sum of the sizes of all entries in the cache. + * Thus we should have the invarient that clean_index_size + + * dirty_index_size == index_size. + * + * WARNING: + * + * 1) The clean_index_size field is not maintained by the + * index macros, as the hash table doesn't care whether + * the entry is clean or dirty. Instead the field is + * maintained in the H5C__UPDATE_RP macros. + * + * 2) The value of the clean_index_size must not be mistaken + * for the current clean size of the cache. Rather, the + * clean size of the cache is the current value of + * clean_index_size plus the amount of empty space (if any) + * in the cache. + * + * dirty_index_size: Number of bytes of dirty entries currently stored in + * the hash table. Note that the index_size field (above) + * is also the sum of the sizes of all entries in the cache. + * Thus we should have the invarient that clean_index_size + + * dirty_index_size == index_size. + * + * WARNING: + * + * 1) The dirty_index_size field is not maintained by the + * index macros, as the hash table doesn't care whether + * the entry is clean or dirty. Instead the field is + * maintained in the H5C__UPDATE_RP macros. + * * index: Array of pointer to H5C_cache_entry_t of size * H5C__HASH_TABLE_LEN. At present, this value is a power * of two, not the usual prime number. @@ -722,6 +754,12 @@ * max_index_size: Largest value attained by the index_size field in the * current epoch. * + * max_clean_index_size: Largest value attained by the clean_index_size field + * in the current epoch. + * + * max_dirty_index_size: Largest value attained by the dirty_index_size field + * in the current epoch. + * * max_slist_len: Largest value attained by the slist_len field in the * current epoch. * @@ -740,6 +778,23 @@ * max_pel_size: Largest value attained by the pel_size field in the * current epoch. * + * calls_to_msic: Total number of calls to H5C_make_space_in_cache + * + * total_entries_skipped_in_msic: Number of clean entries skipped while + * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * + * total_entries_scanned_in_msic: Number of clean entries skipped while + * enforcing the min_clean_fraction in H5C_make_space_in_cache(). + * + * max_entries_skipped_in_msic: Maximum number of clean entries skipped + * in any one call to H5C_make_space_in_cache(). + * + * max_entries_scanned_in_msic: Maximum number of entries scanned over + * in any one call to H5C_make_space_in_cache(). + * + * entries_scanned_to_make_space: Number of entries scanned only when looking + * for entries to evict in order to make space in cache. + * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * @@ -830,6 +885,8 @@ struct H5C_t int32_t index_len; size_t index_size; + size_t clean_index_size; + size_t dirty_index_size; H5C_cache_entry_t * (index[H5C__HASH_TABLE_LEN]); @@ -923,6 +980,8 @@ struct H5C_t int32_t max_index_len; size_t max_index_size; + size_t max_clean_index_size; + size_t max_dirty_index_size; int32_t max_slist_len; size_t max_slist_size; @@ -933,6 +992,13 @@ struct H5C_t int32_t max_pel_len; size_t max_pel_size; + int64_t calls_to_msic; + int64_t total_entries_skipped_in_msic; + int64_t total_entries_scanned_in_msic; + int32_t max_entries_skipped_in_msic; + int32_t max_entries_scanned_in_msic; + int64_t entries_scanned_to_make_space; + #if H5C_COLLECT_CACHE_ENTRY_STATS int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; |