Repository navigation
Mmap engine fixes - #2017
Merged
Merged
Mmap engine fixes#2017
Conversation
Owner
|
Look good to me, but can you please add your Signed-off-by to the commits? See other commits in the tree. |
Previously, "fadvise_hint=0" would disable madvise hints, and any other value including the default would set the hint according to the workload type. This patch adds suport for explicitly setting "sequential" and "random" independent of the workload type. Note that "reuse" is not supported for madvise(). Signed-off-by: Geert Jansen <geertj@google.com>
This fixes the offset/size calculation when "offset" > 0. Previously this had:
fmd->mmap_sz = f->io_size;
fmd->mmap_off = 0;
This is correct only when "offset" (ie f->file_offset) = 0. We can fix this by
either keeping the offset at 0, and map the entire file, or by keeping the size
at f->io_size and setting mmap_off = f->file_offset. On 64-bit there isn't much
difference but on 32-bit the second option is better as it maps less memory.
This patch therefore takes the second approach.
Signed-off-by: Geert Jansen <geertj@google.com>
The engine supports a "full" mode where the entire range for a job is mapped, and a "limited" mode that tries to map less memory. This fixes a bug and implements the following simplified logic: - If we are on a 64-bit architecture, or if io_size <= mmap_map_size, then we map the entire io_size region, and re-use for all IO. - Otherwise, we map the range for each individual IOs. Previously, we would fallback to limited mode in case of 32-bit overflow of the job size. That isn't strict enough as we want to stay below mmap_map_size for a single mapping. This fixes that. Also, in limited mode, this code previously tried to map min(io_size, mmap_map_size) bytes, starting at the offset. This could allow a future IO use the same mapping if happens at a higher offset. I think it's better to keep it simple and get the consistent performance of always having one mmap per IO in limited mode. Signed-off-by: Geert Jansen <geertj@google.com>
Contributor
Author
@axboe done. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please see the individual commit descriptions: