[dfsan] Turn off THP at dfsan_flush
https://reviews.llvm.org/D89662 turned this off at dfsan_init.
dfsan_flush also needs to turn it off.
W/o this a program may get more and more memory usage after hours.
Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D96569
GitOrigin-RevId: 7590c0078dd53d9ad508725fc27d96705ac3a206
diff --git a/lib/dfsan/dfsan.cpp b/lib/dfsan/dfsan.cpp
index 43a5fe9..7abdf68 100644
--- a/lib/dfsan/dfsan.cpp
+++ b/lib/dfsan/dfsan.cpp
@@ -551,7 +551,7 @@
}
extern "C" void dfsan_flush() {
- if (!MmapFixedNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr()))
+ if (!MmapFixedSuperNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr()))
Die();
}
@@ -560,8 +560,7 @@
::InitializePlatformEarly();
- if (!MmapFixedSuperNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr()))
- Die();
+ dfsan_flush();
if (common_flags()->use_madv_dontdump)
DontDumpShadowMemory(ShadowAddr(), UnusedAddr() - ShadowAddr());