Revert "Fallback to stop-the-world compaction on kernel < 5.13 hosts"
This reverts commit aac790f8ffe107c24f2487e93ab6f5b5598c4419.
Reason for revert: Not working as intended. The userfaultfd GC is still being chosen even if kernel version is < 5.13 (b/242181443).
Test: presubmit
Change-Id: I65a05ed44539e5629f4b4f584823cca5e3ca36a9
diff --git a/runtime/gc/collector/mark_compact.cc b/runtime/gc/collector/mark_compact.cc
index 21e63e2..8240711 100644
--- a/runtime/gc/collector/mark_compact.cc
+++ b/runtime/gc/collector/mark_compact.cc
@@ -65,7 +65,7 @@
// on target is not required as MREMAP_DONTUNMAP and userfaultfd were enabled
// together.
#ifdef ART_TARGET
-static constexpr bool gHaveMremapDontunmap = true;
+static const bool gHaveMremapDontunmap = true;
#else
static const bool gHaveMremapDontunmap = IsKernelVersionAtLeast(5, 13);
#endif
@@ -74,12 +74,6 @@
static bool ShouldUseUserfaultfd() {
#if !defined(__linux__)
return false;
-#elif !defined(ART_TARGET)
- // TODO: Try removing the following constraint once the host kernel version is
- // upgraded (b/242181443)
- if (!gHaveMremapDontunmap) {
- return false;
- }
#endif
int fd = syscall(__NR_userfaultfd, O_CLOEXEC | UFFD_USER_MODE_ONLY);
#ifndef ART_TARGET