Skip to content

Commit 3779d45

Browse files
committed
Remove mlock from load_into()
1 parent 0b3e9ac commit 3779d45

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

extension/data_loader/mmap_data_loader.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -332,38 +332,6 @@ Error MmapDataLoader::load_into(
332332
fd_,
333333
range.start);
334334

335-
if (mlock_config_ == MlockConfig::UseMlock ||
336-
mlock_config_ == MlockConfig::UseMlockIgnoreErrors) {
337-
int err = ::mlock(pages, size);
338-
if (err < 0) {
339-
if (mlock_config_ == MlockConfig::UseMlockIgnoreErrors) {
340-
ET_LOG(
341-
Debug,
342-
"Ignoring mlock error for file %s (off=0x%zd): "
343-
"mlock(%p, %zu) failed: %s (%d)",
344-
file_name_,
345-
offset,
346-
pages,
347-
size,
348-
::strerror(errno),
349-
errno);
350-
} else {
351-
ET_LOG(
352-
Error,
353-
"File %s (off=0x%zd): mlock(%p, %zu) failed: %s (%d)",
354-
file_name_,
355-
offset,
356-
pages,
357-
size,
358-
::strerror(errno),
359-
errno);
360-
::munmap(pages, size);
361-
return Error::NotSupported;
362-
}
363-
}
364-
// No need to keep track of this. munmap() will unlock as a side effect.
365-
}
366-
367335
// Offset into mapped region.
368336
const size_t map_delta = offset - range.start;
369337

0 commit comments

Comments
 (0)