summaryrefslogtreecommitdiffstats
path: root/src/H5Cprivate.h
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2008-01-20 05:01:29 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2008-01-20 05:01:29 (GMT)
commit9d241fd66ee144f5c815d209013ad26f2f1b28e0 (patch)
treedbebb0fe444c450d9b081d780632f1cd856ed239 /src/H5Cprivate.h
parent506d25b5f2b7950563be9927db54f60cd7f14309 (diff)
downloadhdf5-9d241fd66ee144f5c815d209013ad26f2f1b28e0.zip
hdf5-9d241fd66ee144f5c815d209013ad26f2f1b28e0.tar.gz
hdf5-9d241fd66ee144f5c815d209013ad26f2f1b28e0.tar.bz2
[svn-r14445] Added code to detect the situation in which a metadata cache entry flush
callback functions modifies the skip list or LRU out from under a partial or complete flush of the cache. This is a test for a situation that should not occur, but we test anyway. Also added code to skip longer tests in cache_api in express tests. Tested serial and parallel on phoenix (debian --x86-32), and commit test. Elena commit tested as well, and ran a manual test under MacOS X.
Diffstat (limited to 'src/H5Cprivate.h')
-rw-r--r--src/H5Cprivate.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 10585a3..53dcf0d 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -37,7 +37,7 @@
#include "H5Fprivate.h" /* File access */
-#define H5C_DO_SANITY_CHECKS 1
+#define H5C_DO_SANITY_CHECKS 0
#define H5C_DO_EXTREME_SANITY_CHECKS 0
/* This sanity checking constant was picked out of the air. Increase
@@ -51,7 +51,7 @@
/* H5C_COLLECT_CACHE_STATS controls overall collection of statistics
* on cache activity. In general, this #define should be set to 0.
*/
-#define H5C_COLLECT_CACHE_STATS 1
+#define H5C_COLLECT_CACHE_STATS 0
/* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics
* in individual cache entries.
@@ -202,6 +202,27 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
*
* JRM - 4/26/04
*
+ * magic: Unsigned 32 bit integer that must always be set to
+ * H5C__H5C_CACHE_ENTRY_T_MAGIC when the entry is valid.
+ * The field must be set to H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC
+ * just before the entry is freed.
+ *
+ * This is necessary, as the LRU list can be changed out
+ * from under H5C_make_space_in_cache() by the flush
+ * callback which may change the size of an existing entry,
+ * and/or load a new entry while serializing the target entry.
+ *
+ * This in turn can cause a recursive call to
+ * H5C_make_space_in_cache() which may either flush or evict
+ * the next entry that the first invocation of that function
+ * was about to examine.
+ *
+ * The magic field allows H5C_make_space_in_cache() to
+ * detect this case, and re-start its scan from the bottom
+ * of the LRU when this situation occurs.
+ *
+ * This field is only compiled in debug mode.
+ *
* addr: Base address of the cache entry on disk.
*
* size: Length of the cache entry on disk. Note that unlike normal
@@ -442,8 +463,16 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
*
****************************************************************************/
+#ifndef NDEBUG
+#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
+#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
+#endif /* NDEBUG */
+
typedef struct H5C_cache_entry_t
{
+#ifndef NDEBUG
+ uint32_t magic;
+#endif /* NDEBUG */
haddr_t addr;
size_t size;
const H5C_class_t * type;