Commit 1a3e01f
committed
engines/mmap: fix full/limited prep logic
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 <[email protected]>1 parent 4857911 commit 1a3e01f
1 file changed
+4
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | 160 | | |
| 161 | + | |
165 | 162 | | |
166 | 163 | | |
167 | 164 | | |
| |||
177 | 174 | | |
178 | 175 | | |
179 | 176 | | |
180 | | - | |
181 | | - | |
| 177 | + | |
| 178 | + | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
| |||
0 commit comments