In await_signal(), print a less alarming message when exiting in normal
circumstances.
Write a comment that tells why await_signal() periodically calls the HDF5 API.
Break metadata reads and writes into up to three pieces, the non-page-aligned
piece in the beginning, 1 or more full pages, and whatever is leftover at the
end. Passes all of our tests.
Add an environment variable, H5_SHADOW_INDEX_FAIL, that I can set to an
unsigned integer value that tells at which index to inject a failure
for testing purposes. I used this to establish that I can start the
shadow-index lookup test with a previous seed and see the same tests run
again.
Move the `swmr` log-outlet declaration to H5FDvfd_swmr_private.h and use `swmr`
as the parent outlet of a new outlet for messages about the motion of the
shadow index.
On the reader, zero the shadow-index entries before filling fields from the
shadow file so that members like `garbage` are not filled with garbage that
fools us, later.
Where n is the number of page-table/shadow-index entries, avoid spending O(n^2)
time in H5PB_dest(). While we're in H5PB_dest(), mark deleted shadow-index
entries as "garbage" and skip the O(n) shadow index-entries copy.
Rename shadow index-entry member `moved_to_hdf5_file` to `moved_to_lower_file`
while I'm in here---NFCI.
Add log outlets `h5mf` and `h5mf_defer` and write some diagnostic
messages to them.
Move and update a comment about removing (all) items from the deferred queue
before processing them.
Bug fix: don't leak file space, add back to the deferred queue all items that
were not disposed of.
Don't use the __ prefix for attributes __unused and such, since that's reserved
for the system software, IIUC, and it clashes with a symbol on CentOS.
Instead, use a _ prefix.
Add a log outlet for shadow-index enlargement and use it instead of
mysteriously printing "ding ding!" when the shadow index is enlarged.
While I'm here, place the new index into place regardless of whether we succeed
at the deferred free of the old index's shadow-file space.
In process_deferred_frees(), remove *all* deferred frees from the
H5F_shared_t's queue before processing any, instead of removing just one,
processing it, removing another, processing it, and so on. While we processed
the first entry on the queue, we often called H5MF_xfree() again, which called
process_deferred_frees() again, which processed the first entry, calling
H5MF_xfree() again, and on and on, until the deferred frees list was exhausted.
This deep recursion showed up as a wide, tall ...
Share latest changes: change many occurrences of "metadata" file/index/header
to "shadow" file/index/header. Simplify the description of freespace
management. Finish describing the floating shadow index.
Add a new log outlet for individual deferred shadow frees and use it.
Rename a variable that tells whether or not we started with an empty
deferred-free list, and take care not to set it excessively.
Delete misleading "Programmer:" field and excessive decoration from the
H5FD_vfd_swmr_write() comment header. Delete a superfluous comment. Delete
some whitespace at EOL. NFCI.
Record the state of a log outlet on first use and reuse that state on
subsequent hlog_fast() calls.
While I'm here, add a typedef, hlog_outlet_t, for struct hlog_outlet, and use
it.
Rename loglib_ / LOGLIB_ to hlog_ / HLOG_, remove the syslog-based
implementation, rename hlog_log() to hlog(), hlog_vlog() to vhlog(), et cetera.
Rename hlog_lazy() to hlog_fast().
Define some log sinks and use them in the page buffer and in VFD SWMR.
Update punch list a bit: mention the over-long postponement of shadow-index
reclamation. Mention that a writer can delete an object out from under a
reader who holds an hid_t for it.
Escape some underscores. I'm not sure if this is strictly necessary, but vim's
syntax highlighting colors some (but not all) unescaped underscores red like
there is some problem. It's possible there is some problem, since underscores
are used to indicate some kind of emphasis---probably underlining.
Extract a routine from shadow_image_defer_free(), shadow_range_defer_free(),
that works in byte offsets rather than page offsets. Use
shadow_range_defer_free() to defer shadow-index frees.
Avoid going back and forth between signed and unsigned in the same expression
with some casts and an unsigned constant. This quiets GCC warnings, especially
-Wconversion, IIRC.
Reduce code duplication by using vfd_swmr_pageno_to_mdf_idx_entry() to look up
shadow pages. Reduce casts by choosing correct format strings and compatible
variable types.
Poison writes to addr by making it const. Don't increase addr in the read(2)
loop because it's never used afterward.
Delete some more dead code.
Rename read_ptr as p and declare it much closer to its use. Change its type to
`char *` so that no casts are necessary to increase it.