diff options
author | mainzer <mainzer#hdfgroup.org> | 2020-03-26 15:26:49 (GMT) |
---|---|---|
committer | mainzer <mainzer#hdfgroup.org> | 2020-03-26 15:26:49 (GMT) |
commit | 0135ec8d61ab11cce5b9d622c906a59806a7cd18 (patch) | |
tree | b929f5b8c7892a3dbf19eb02b68487310eb01572 /src | |
parent | 14a8543c7a88f835e3b0633637cd427447cabc85 (diff) | |
download | hdf5-0135ec8d61ab11cce5b9d622c906a59806a7cd18.zip hdf5-0135ec8d61ab11cce5b9d622c906a59806a7cd18.tar.gz hdf5-0135ec8d61ab11cce5b9d622c906a59806a7cd18.tar.bz2 |
Reverted optimization in the metadata cache that avoided re-reading
the first portion of a metadata cache entry in speculative reads.
This is necessary for VFD SWMR as it presumes that metadata entries
are read and written atomically. See comments in H5C.c / H5C_load_entry()
for further details.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5C.c | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -7070,6 +7070,14 @@ done: * * Programmer: John Mainzer, 5/18/04 * + * Changes: Please maintain the change list and do not delete entries + * unless the have been folded into the header comment. + * + * Reverted optimization that avoided re-reading the prefix + * of a metadata entry when a speculative read proved too + * small. + * JRM -- 3/25/20 + * *------------------------------------------------------------------------- */ static void * @@ -7289,6 +7297,7 @@ H5C_load_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL if ( !coll_access || 0 == mpi_rank ) { #endif /* H5_HAVE_PARALLEL */ +#if 0 /* JRM */ /* If the thing's image needs to be bigger for * a speculatively loaded thing, go get the * on-disk image again (the extra portion). @@ -7298,6 +7307,46 @@ H5C_load_entry(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, \ "can't read image") +#else /* JRM */ + + /* the original version of this code re-read + * the entire buffer. At some point, someone + * reworked this code to avoid re-reading the + * initial portion of the buffer. + * + * In addition to being of questionable utility, + * this optimization changed the invarient that + * that metadata is read and written atomically. + * While this didn't cause immediate problems, + * the page buffer in VFD SWMR depends on this + * invarient in its management of multi-page + * metadata entries. + * + * To repair this issue, I have reverted to + * the original algorithm for managing the + * speculative load case. Note that I have + * done so crudely -- before merge, we should + * remove the infrastructure that supports the + * optimization. + * + * We should also verify my impression that the + * that the optimization is of no measurable + * value. If it is, we will put it back, but + * disable it in the VFD SWMR case. + * + * While this issue was detected in the global + * heap case, note that the super bloc, the + * local heap, and the fractal heap also use + * speculative loads. + * + * JRM -- 3/24/20 + */ + if ( H5F_block_read(f, type->mem_type, addr, + actual_len, image) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, \ + "can't read image") +#endif /* JRM */ #ifdef H5_HAVE_PARALLEL } /* If the collective metadata read optimization is |