mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
Better segregate clean & dirty LRU lists so that they are only defined when
the H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS macro is defined.
This commit is contained in:
parent
faf723e6d5
commit
744b6b282f
@ -366,6 +366,7 @@ H5C_create(size_t max_cache_size,
|
||||
cache_ptr->coll_write_list = NULL;
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
cache_ptr->cLRU_list_len = 0;
|
||||
cache_ptr->cLRU_list_size = (size_t)0;
|
||||
cache_ptr->cLRU_head_ptr = NULL;
|
||||
@ -375,6 +376,7 @@ H5C_create(size_t max_cache_size,
|
||||
cache_ptr->dLRU_list_size = (size_t)0;
|
||||
cache_ptr->dLRU_head_ptr = NULL;
|
||||
cache_ptr->dLRU_tail_ptr = NULL;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
|
||||
cache_ptr->size_increase_possible = FALSE;
|
||||
cache_ptr->flash_size_increase_possible = FALSE;
|
||||
@ -1481,8 +1483,10 @@ H5C_insert_entry(H5F_t * f,
|
||||
entry_ptr->next = NULL;
|
||||
entry_ptr->prev = NULL;
|
||||
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
entry_ptr->aux_next = NULL;
|
||||
entry_ptr->aux_prev = NULL;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
entry_ptr->coll_next = NULL;
|
||||
@ -6949,8 +6953,10 @@ H5C_load_entry(H5F_t * f,
|
||||
entry->next = NULL;
|
||||
entry->prev = NULL;
|
||||
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
entry->aux_next = NULL;
|
||||
entry->aux_prev = NULL;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
entry->coll_next = NULL;
|
||||
@ -7285,6 +7291,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed,
|
||||
|
||||
HDassert( H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS );
|
||||
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
initial_list_len = cache_ptr->cLRU_list_len;
|
||||
entry_ptr = cache_ptr->cLRU_tail_ptr;
|
||||
|
||||
@ -7329,6 +7336,7 @@ H5C__make_space_in_cache(H5F_t *f, hid_t dxpl_id, size_t space_needed,
|
||||
entry_ptr = prev_ptr;
|
||||
entries_examined++;
|
||||
}
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -716,6 +716,7 @@ H5C_stats(H5C_t * cache_ptr,
|
||||
(long)(cache_ptr->LRU_list_size),
|
||||
(unsigned long)(cache_ptr->LRU_list_len));
|
||||
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
HDfprintf(stdout,
|
||||
"%s current clean LRU size / length = %ld / %lu\n",
|
||||
cache_ptr->prefix,
|
||||
@ -727,6 +728,7 @@ H5C_stats(H5C_t * cache_ptr,
|
||||
cache_ptr->prefix,
|
||||
(long)(cache_ptr->dLRU_list_size),
|
||||
(unsigned long)(cache_ptr->dLRU_list_len));
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
|
||||
HDfprintf(stdout,
|
||||
"%s Total hits / misses / hit_rate = %ld / %ld / %f\n",
|
||||
|
@ -649,8 +649,10 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr,
|
||||
/* Initialize fields supporting replacement policies: */
|
||||
ds_entry_ptr->next = NULL;
|
||||
ds_entry_ptr->prev = NULL;
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
ds_entry_ptr->aux_next = NULL;
|
||||
ds_entry_ptr->aux_prev = NULL;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
pf_entry_ptr->coll_next = NULL;
|
||||
pf_entry_ptr->coll_prev = NULL;
|
||||
|
@ -4746,6 +4746,7 @@ struct H5C_t {
|
||||
H5C_cache_entry_t * LRU_head_ptr;
|
||||
H5C_cache_entry_t * LRU_tail_ptr;
|
||||
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
/* Fields for clean LRU list of entries */
|
||||
uint32_t cLRU_list_len;
|
||||
size_t cLRU_list_size;
|
||||
@ -4757,6 +4758,7 @@ struct H5C_t {
|
||||
size_t dLRU_list_size;
|
||||
H5C_cache_entry_t * dLRU_head_ptr;
|
||||
H5C_cache_entry_t * dLRU_tail_ptr;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/* Fields for collective metadata reads */
|
||||
|
@ -1648,8 +1648,10 @@ typedef struct H5C_cache_entry_t {
|
||||
/* fields supporting replacement policies: */
|
||||
struct H5C_cache_entry_t *next;
|
||||
struct H5C_cache_entry_t *prev;
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
struct H5C_cache_entry_t *aux_next;
|
||||
struct H5C_cache_entry_t *aux_prev;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
struct H5C_cache_entry_t *coll_next;
|
||||
struct H5C_cache_entry_t *coll_prev;
|
||||
|
@ -3116,13 +3116,14 @@ check_insert_entry(unsigned paged)
|
||||
(cache_ptr->pel_len != 2) ||
|
||||
(cache_ptr->pel_size != 2 * entry_sizes[entry_type]) ||
|
||||
(cache_ptr->LRU_list_len != 2) ||
|
||||
(cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type]) ||
|
||||
(cache_ptr->LRU_list_size != 2 * entry_sizes[entry_type])
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
(cache_ptr->dLRU_list_len != 2) ||
|
||||
|| (cache_ptr->dLRU_list_len != 2) ||
|
||||
(cache_ptr->dLRU_list_size != 2 * entry_sizes[entry_type]) ||
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
(cache_ptr->cLRU_list_len != 0) ||
|
||||
(cache_ptr->cLRU_list_size != (size_t)0)) {
|
||||
(cache_ptr->cLRU_list_size != (size_t)0)
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
) {
|
||||
|
||||
pass = FALSE;
|
||||
failure_mssg = "Unexpected insert results 10.";
|
||||
|
@ -2436,8 +2436,10 @@ reset_entries(void)
|
||||
base_addr[j].header.ro_ref_count = FALSE;
|
||||
base_addr[j].header.next = NULL;
|
||||
base_addr[j].header.prev = NULL;
|
||||
#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
|
||||
base_addr[j].header.aux_next = NULL;
|
||||
base_addr[j].header.aux_prev = NULL;
|
||||
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
|
||||
|
||||
base_addr[j].self = &(base_addr[j]);
|
||||
base_addr[j].cache_ptr = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user