Improve caching for dbuf prefetches #18160
Open
+8
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To avoid read errors with transaction open
dmu_tx_check_ioerr()is used to read everything required in advance. But there seems to be a chance for the buffer to be evicted from dbuf cache in between, which results in immediate eviction from ARC, which may require additional disk read later, in a place where error handling is problematic.To partially workaround this introduce a new flag
DMU_IS_PREFETCH, relayed to ARC asARC_FLAG_PREFETCH | ARC_FLAG_PRESCIENT_PREFETCH, making ARC delay eviction by at least several seconds, or till the actual read inside the transaction, that will promote it to demand access.Types of changes
Checklist:
Signed-off-by.