summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-12-30 13:44:15 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-12-30 13:44:15 (GMT)
commit8215920678c09238ecc86d9eecc03a634f96d2d0 (patch)
tree4012f77323e147b1883a77cb0f0a17605720a1c0 /test
parent5e26cd2d824ea05e5ae5ca3aebaa439a9b80e7fc (diff)
parent0610c41c75920b145a144e62df142977b605fc97 (diff)
downloadhdf5-8215920678c09238ecc86d9eecc03a634f96d2d0.zip
hdf5-8215920678c09238ecc86d9eecc03a634f96d2d0.tar.gz
hdf5-8215920678c09238ecc86d9eecc03a634f96d2d0.tar.bz2
Merge pull request #225 in HDFFV/hdf5 from develop_merge_cache_image_03 to develop
Merged incoming changes from cache_image. * commit '0610c41c75920b145a144e62df142977b605fc97': Bring support for doubly-linked list of all entries in cache from incoming cache image branch. Align with name change of "user" ring in incoming cache image changes. Refactor several cache clients to have only one copy of their deserialization code.
Diffstat (limited to 'test')
-rw-r--r--test/cache.c48
-rw-r--r--test/cache_common.h36
2 files changed, 51 insertions, 33 deletions
diff --git a/test/cache.c b/test/cache.c
index 0cd0c99..ed4fceb 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -15913,7 +15913,6 @@ check_destroy_pinned_err(void)
unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG);
if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) {
-
pass = FALSE;
failure_mssg = "destroy succeeded on cache with pinned entry.\n";
} /* end if */
@@ -34541,7 +34540,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr)
if(pass)
if((cache_ptr->slist_scan_restarts != 1) ||
(cache_ptr->LRU_scan_restarts != 0) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "unexpected scan restart stats in cedds__expunge_dirty_entry_in_flush_test().";
} /* end if */
@@ -34920,7 +34919,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
if(pass)
if((cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 1) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "unexpected scan restart stats in cedds__H5C_make_space_in_cache().";
@@ -35330,7 +35329,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
if(pass)
if((cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 1) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "unexpected scan restart stats in cedds__H5C__autoadjust__ageout__evict_aged_out_entries().";
@@ -35353,7 +35352,26 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
/*-------------------------------------------------------------------------
* Function: cedds__H5C_flush_invalidate_cache__bucket_scan()
*
- * Purpose: Verify that H5C_flush_invalidate_cache() can handle
+ * Purpose: Note: We now use the index list when we scan the
+ * contents of the metadata cache, so in principal,
+ * this test is obsolete. However, even using the
+ * index list, restarts are possible, and must be
+ * handled gracefully.
+ *
+ * As it turns out, this test triggers index list
+ * scan restarts, and thus with minor changes is
+ * still a useful test.
+ *
+ * For this reason, with the exception of changing
+ * to check the index_scan_restart stat instead of
+ * hash bucket restarts, I'm leaving the test
+ * alone. If and when it starts to fail due to
+ * other changes, we can re-work it to test
+ * index list scan restarts explicitly.
+ *
+ * JRM -- 11/2/16
+ *
+ * Verify that H5C_flush_invalidate_cache() can handle
* the removal from the cache of the next item in
* its scans of hash buckets.
*
@@ -35455,20 +35473,20 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(cache_ptr == NULL) {
pass = FALSE;
- failure_mssg = "cache_ptr NULL on entry to cedds for H5C__autoadjust__ageout__evict_aged_out_entries() test.";
+ failure_mssg = "cache_ptr NULL on entry to cedds for cedds__H5C_flush_invalidate_cache__bucket_scan() test.";
}
else if((cache_ptr->index_len != 0) ||
(cache_ptr->index_size != 0)) {
pass = FALSE;
- failure_mssg = "cache not empty at start cedds for H5C__autoadjust__ageout__evict_aged_out_entries() test.";
+ failure_mssg = "cache not empty at start cedds for cedds__H5C_flush_invalidate_cache__bucket_scan() test.";
}
else if((cache_ptr->max_cache_size != (2 * 1024 * 1024)) ||
(cache_ptr->min_clean_size != (1 * 1024 * 1024))) {
pass = FALSE;
failure_mssg =
- "unexpected cache config at start of cedds H5C__autoadjust__ageout__evict_aged_out_entries() test.";
+ "unexpected cache config at start of cedds cedds__H5C_flush_invalidate_cache__bucket_scan() test.";
} else {
@@ -35696,9 +35714,13 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
} /* end if */
if(pass)
+ /* as this test is now checking for index list scan restarts,
+ * the following has been modified to check this instead of
+ * hash bucket scan restarts.
+ */
if((cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 0) ||
- (cache_ptr->hash_bucket_scan_restarts != 1)) {
+ (cache_ptr->index_scan_restarts != 1)) {
pass = FALSE;
failure_mssg = "unexpected scan restart stats in cedds__H5C_flush_invalidate_cache__bucket_scan().";
}
@@ -35912,7 +35934,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
(cache_ptr->entries_scanned_to_make_space != 0) ||
(cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 0) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(1).";
@@ -35997,7 +36019,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
(cache_ptr->entries_scanned_to_make_space != 0) ||
(cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 0) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(2).";
@@ -36082,7 +36104,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
(cache_ptr->entries_scanned_to_make_space != 33) ||
(cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 0) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(3).";
@@ -36186,7 +36208,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
(cache_ptr->entries_scanned_to_make_space != 33) ||
(cache_ptr->slist_scan_restarts != 0) ||
(cache_ptr->LRU_scan_restarts != 0) ||
- (cache_ptr->hash_bucket_scan_restarts != 0)) {
+ (cache_ptr->index_scan_restarts != 0)) {
pass = FALSE;
failure_mssg = "Unexpected cache stats in check_stats__smoke_check_1(4).";
diff --git a/test/cache_common.h b/test/cache_common.h
index 1ab04cb..befcee4 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -384,7 +384,7 @@ if ( ( (cache_ptr) == NULL ) || \
HDfprintf(stdout, "Pre HT search SC failed.\n"); \
}
-#define H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \
+#define H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, k) \
if ( ( (cache_ptr) == NULL ) || \
( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \
( (cache_ptr)->index_len < 1 ) || \
@@ -392,7 +392,6 @@ if ( ( (cache_ptr) == NULL ) || \
( (cache_ptr)->index_size < (entry_ptr)->size ) || \
( (cache_ptr)->index_size != \
((cache_ptr)->clean_index_size + (cache_ptr)->dirty_index_size) ) || \
- ( H5F_addr_ne((entry_ptr)->addr, (Addr)) ) || \
( (entry_ptr)->size <= 0 ) || \
( ((cache_ptr)->index)[k] == NULL ) || \
( ( ((cache_ptr)->index)[k] != (entry_ptr) ) && \
@@ -416,32 +415,29 @@ if ( ( (cache_ptr) == NULL ) || \
#define H5C_TEST__SEARCH_INDEX(cache_ptr, Addr, entry_ptr) \
{ \
int k; \
- int depth = 0; \
H5C_TEST__PRE_HT_SEARCH_SC(cache_ptr, Addr) \
k = H5C__HASH_FCN(Addr); \
entry_ptr = ((cache_ptr)->index)[k]; \
- while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \
+ while ( entry_ptr ) \
{ \
- (entry_ptr) = (entry_ptr)->ht_next; \
- (depth)++; \
- } \
- if ( entry_ptr ) \
- { \
- H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \
- if ( entry_ptr != ((cache_ptr)->index)[k] ) \
+ if ( H5F_addr_eq(Addr, (entry_ptr)->addr) ) \
{ \
- if ( (entry_ptr)->ht_next ) \
+ H5C_TEST__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, k) \
+ if ( entry_ptr != ((cache_ptr)->index)[k] ) \
{ \
- (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \
+ if ( (entry_ptr)->ht_next ) \
+ (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \
+ HDassert( (entry_ptr)->ht_prev != NULL ); \
+ (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \
+ ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \
+ (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \
+ (entry_ptr)->ht_prev = NULL; \
+ ((cache_ptr)->index)[k] = (entry_ptr); \
+ H5C_TEST__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k) \
} \
- HDassert( (entry_ptr)->ht_prev != NULL ); \
- (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \
- ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \
- (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \
- (entry_ptr)->ht_prev = NULL; \
- ((cache_ptr)->index)[k] = (entry_ptr); \
- H5C_TEST__POST_HT_SHIFT_TO_FRONT(cache_ptr, entry_ptr, k) \
+ break; \
} \
+ (entry_ptr) = (entry_ptr)->ht_next; \
} \
}