summaryrefslogtreecommitdiffstats
path: root/src/H5Cimage.c
diff options
context:
space:
mode:
authormainzer <mainzer#hdfgroup.org>2020-04-29 16:34:46 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-05-21 14:51:39 (GMT)
commit18dab4e5767fcf9cdad2220d1a89f1ae7b002dd1 (patch)
treeaf43b990d3e5c90591c24974114ac0335df6ae25 /src/H5Cimage.c
parentd5ad503cfe37263c903a2a755c464c42d67530c4 (diff)
downloadhdf5-18dab4e5767fcf9cdad2220d1a89f1ae7b002dd1.zip
hdf5-18dab4e5767fcf9cdad2220d1a89f1ae7b002dd1.tar.gz
hdf5-18dab4e5767fcf9cdad2220d1a89f1ae7b002dd1.tar.bz2
Modified page buffer to split entries only where necessary -- specifically
when handling an I/O request on a metadata entry that has been sub-allocated from a larger file space allocation (i.e. fixed and extensible array), and that crosses at least one page boundary. . This required modifying the metadata cache to provide the type of the metadata cache entry in the current I/O request. For now, this is done with a function call. Once we are sure this works, it may be appropriate to convert this to a macro, or to add a flags parameter to the H5F block read/write calls. Also updated the metadata cache to report whether a read request is speculative -- again via a function call. This allowed me to remove the last address static variable in the H5PB_read() call, which is necessary to support multiple files opened in VFD SWMR mode. Also re-wrote the H5PB_remove_entries() call to handle release of large metadata file space allocations that have been sub-allocated into multiple metadata entries. Also modified the call to H5PB_remove_entries() in H5MF__xfree_impl() to invoke it whenever the page buffer is enabled and the size of the space to be freed is of page size or larger. Tested serial / debug on charis and Jelly. Found a bug in H5MF_xfree_impl(), in which the call to H5PB_remove_entries() is skipped due to HGOTO_DONE calls earlier in the function. While the obvious action is to move the call earlier in the function, best to consult with Vailin first, as there is much going on and it would be best to avoid making the situation worse. If nothing else, there are some error management issues.
Diffstat (limited to 'src/H5Cimage.c')
-rw-r--r--src/H5Cimage.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/H5Cimage.c b/src/H5Cimage.c
index ee286d9..9a6d667 100644
--- a/src/H5Cimage.c
+++ b/src/H5Cimage.c
@@ -1058,6 +1058,22 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr)
#endif /* H5_HAVE_PARALLEL */
/* Read the buffer (if serial access, or rank 0 of parallel access) */
+
+ /* No need to set the page buffer hints here, as if paged
+ * allocation is in use, we know that the cache image was allocated
+ * directly from the free space manager, and thus either doesn't
+ * cross page boundaries, or is page aligned. Between this,
+ * and the fact that the cache image is never read speculatively,
+ * the page buffer should never request hints in this context.
+ *
+ * If for some reason it does, the NULL curr_io_type will trigger
+ * an assertion failure.
+ *
+ * Note that we will have to revisit this if we ever use
+ * cache_ptr->curr_io_type for something other than sanity
+ * checking
+ * JRM -- 3/30/20
+ */
if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr,
cache_ptr->image_len, cache_ptr->image_buffer) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block")
@@ -3554,6 +3570,19 @@ H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr)
#endif /* H5_HAVE_PARALLEL */
/* Write the buffer (if serial access, or rank 0 for parallel access) */
+
+ /* No need to set the page buffer hints here.
+ *
+ * If paged allocation is in use, we know that the cache image
+ * was allocated directly from the free space manager, and thus
+ * either doesn't cross page boundaries, or is page aligned.
+ * Thus it should never trigger the sanity checks in the page buffer.
+ *
+ * If for some reason it does, the NULL curr_io_type will trigger
+ * an assertion failure.
+ *
+ * JRM -- 3/30/20
+ */
if(H5F_block_write(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, cache_ptr->image_buffer) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't write metadata cache image block to file")
#ifdef H5_HAVE_PARALLEL