From: Dmitry Vyukov Date: Fri, 25 Jul 2014 13:48:25 +0000 (+0000) Subject: tsan: query RSS every 100ms X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6819cf497411afe10738d6792cf208ee9271443a;p=platform%2Fupstream%2Fllvm.git tsan: query RSS every 100ms Now that it become faster, it's OK to query it every 100ms again. llvm-svn: 213943 --- diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc index 3e3e339..1ebd7ec 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.cc @@ -157,7 +157,6 @@ static void BackgroundThread(void *arg) { } u64 last_flush = NanoTime(); - u64 last_rss_check = NanoTime(); uptr last_rss = 0; for (int i = 0; atomic_load(&ctx->stop_background_thread, memory_order_relaxed) == 0; @@ -175,8 +174,7 @@ static void BackgroundThread(void *arg) { } } // GetRSS can be expensive on huge programs, so don't do it every 100ms. - if (flags()->memory_limit_mb > 0 && last_rss_check + 1000 * kMs2Ns < now) { - last_rss_check = now; + if (flags()->memory_limit_mb > 0) { uptr rss = GetRSS(); uptr limit = uptr(flags()->memory_limit_mb) << 20; if (flags()->verbosity > 0) {