diff options
author | David Young <dyoung@hdfgroup.org> | 2019-12-19 19:43:54 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2019-12-19 19:43:54 (GMT) |
commit | dc15a6987e1b10f19a0a692fdd00d5e713701a9a (patch) | |
tree | a0318de2beca1a1928d4132b6e62cfaecf54fd29 /src/H5Fpkg.h | |
parent | 10a7a4741500276804cb245fd8f860286642b76d (diff) | |
download | hdf5-dc15a6987e1b10f19a0a692fdd00d5e713701a9a.zip hdf5-dc15a6987e1b10f19a0a692fdd00d5e713701a9a.tar.gz hdf5-dc15a6987e1b10f19a0a692fdd00d5e713701a9a.tar.bz2 |
Use the "tail queue" from queue(3) for the delayed free list of shadow images.
Delete the little-used free-list length, dl_len, and just count up the list
entries when diagnostic code needs the length.
Extract the code for deferring shadow-image free into a new subroutine,
`vfd_swmr_idx_entry_defer_free()`.
Rename type `deferred_free_head_t` as `deferred_free_queue_t`.
Remove the disused H5F__LL_{REMOVE,PREPEND} macros.
Add some diagnostic code and #if 0'd assertions.
Change `qsort(ptr, n, sizeof(type), cmp)` to
`qsort(ptr, n, sizeof(*ptr), cmp)`.
Use a `continue` statement to lower a staircase in
H5F_update_vfd_swmr_metadata_file().
Add vfd_swmr_mdf_idx_entry_remove() to delete a shadow index entry and add the
image at that entry to a deferred-free list. Call it whenever a page is
evicted.
Update the comment in H5PB_remove_entry() that asks if we need to remove shadow
index entries: now we *do* remove them. Remove shadow index entries in
H5PB__evict_entry(). Also mention in the comment that the index-entry removal
performed by H5PB__evict_entry() ought to be sufficient.
Diffstat (limited to 'src/H5Fpkg.h')
-rw-r--r-- | src/H5Fpkg.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 8acd919..4dfcdc2 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -225,17 +225,15 @@ typedef struct H5F_mtab_t { * length: The length of the metadata page or multi page * metadata entry in BYTES. * tick_num: Sequence # of the current tick - * next: Pointer to the next entry in the the list - * prev: Pointer to the previous entry in the list + * link: tailqueue linkage */ -typedef struct H5F_vfd_swmr_dl_entry_t { +typedef struct old_image { uint64_t hdf5_page_offset; uint64_t md_file_page_offset; uint32_t length; uint64_t tick_num; - struct H5F_vfd_swmr_dl_entry_t *next; - struct H5F_vfd_swmr_dl_entry_t *prev; -} H5F_vfd_swmr_dl_entry_t; + TAILQ_ENTRY(old_image) link; +} old_image_t; /* Structure specifically to store superblock. This was originally * maintained entirely within H5F_shared_t, but is now extracted @@ -266,7 +264,9 @@ typedef struct deferred_free { uint64_t free_after_tick; } deferred_free_t; -typedef SIMPLEQ_HEAD(deferred_free_head, deferred_free) deferred_free_head_t; +typedef SIMPLEQ_HEAD(deferred_free_queue, deferred_free) deferred_free_queue_t; + +typedef TAILQ_HEAD(old_image_queue, old_image) old_image_queue_t; /* * Define the structure to store the file information for HDF5 files. One of @@ -410,7 +410,7 @@ struct H5F_shared_t { */ uint64_t tick_num; /* Number of the current tick */ struct timespec end_of_tick; /* End time of the current tick */ - deferred_free_head_t deferred_frees; /* For use by VFD SWMR writers. */ + deferred_free_queue_t deferred_frees; /* For use by VFD SWMR writers. */ /* VFD SWMR metadata file index */ H5FD_vfd_swmr_idx_entry_t * mdf_idx; /* pointer to an array of instance * of H5FD_vfd_swmr_idx_entry_t of @@ -467,12 +467,7 @@ struct H5F_shared_t { */ /* Delayed free space release doubly linked list */ - uint32_t dl_len; /* # of entries in the list */ - H5F_vfd_swmr_dl_entry_t *dl_head_ptr; /* Points to the beginning of - * the list - */ - H5F_vfd_swmr_dl_entry_t *dl_tail_ptr; /* Points to the end of the list */ - + old_image_queue_t old_images; char *extpath; /* Path for searching target external link file */ #ifdef H5_HAVE_PARALLEL |