[PATCH] D96626: Support: mapped_file_region: Pass MAP_NORESERVE to mmap
Joseph Tremoulet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 12 12:24:53 PST 2021
JosephTremoulet added a comment.
What led me here was failure in LLDB to open large core dumps because the mmap call was failing with the default memory overcommit policy. It's easy to override the policy as a workaround, but it would be nice not to have to. I considered making this a configurable attribute of mapped_file_region (as in a constructor parameter specifying whether OOM failure should be prompt or delayed), which could then be plumbed through so specifically opening core files in LLDB requests it, but I figured this should be consistent across the "Unix" and "Windows" implementations, and AFAICT there's not a good way to have a Linux-style eager-commit/failure on the Windows side, and since delaying the failure is the Windows behavior already, this change does make things consistent. So this is what I ended up with.
I also would have liked to include an LLDB regression test that opens a very large core file, but neither option of committing or dynamically generating a very large input file for that test seemed like a great idea; I'm happy for suggestions on the testing front.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96626/new/
https://reviews.llvm.org/D96626
More information about the llvm-commits
mailing list