[PATCH] D40038: [scudo] Soft and hard RSS limit checks
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 13:51:03 PST 2017
cryptoad added inline comments.
================
Comment at: lib/scudo/scudo_allocator.cpp:318
+ return atomic_load_relaxed(&RssLimitExceeded);
+ const uptr CurrentRssMb = GetRSS() >> 20;
+ if (HardRssLimitMb && HardRssLimitMb < CurrentRssMb) {
----------------
cryptoad wrote:
> alekseyshl wrote:
> > How fast is it? It might read a file, right?
> It either reads `/proc/self/statm`, or falls back to `getrusage` if statm is not allowed.
> So yes, not the fastest of code paths.
> I am not sure I see a way around it though.
Also the common flag is called `can_use_proc_maps_statm`, which is misdirecting, I think it really should be `can_use_proc_self_statm`.
https://reviews.llvm.org/D40038
More information about the llvm-commits
mailing list