[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:48:16 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) {
----------------
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.


================
Comment at: test/scudo/rss.c:45
+    printf("Some of the malloc calls returned NULL (%d)\n", returned_null);
+  printf("Done\n");
+  return 0;
----------------
alekseyshl wrote:
> What's this for?
I added it because it seems that if there is nothing on stdout or stderr, FileCheck complains and fails, which is the case for the "nolimit" tests.


https://reviews.llvm.org/D40038





More information about the llvm-commits mailing list