提交 f91cbf28 编写于 作者: C Chuansheng Lu 提交者: Jonathan Lu

[MultiTenant] Fixed build failure on Windows

Summary: Fixed build failure on Windows by disabling CPU related features

Test Plan: hotspot/test/sanity

Reviewed-by: kuaiwei, yuleil

Issue: https://github.com/alibaba/dragonwell8/issues/92
上级 0834cf41
...@@ -3353,7 +3353,7 @@ bool com_alibaba_tenant_TenantContainer::is_dead(oop obj) { ...@@ -3353,7 +3353,7 @@ bool com_alibaba_tenant_TenantContainer::is_dead(oop obj) {
oop com_alibaba_tenant_TenantContainer::get_tenant_state(oop obj) { oop com_alibaba_tenant_TenantContainer::get_tenant_state(oop obj) {
assert(obj != NULL, "TenantContainer object cannot be NULL"); assert(obj != NULL, "TenantContainer object cannot be NULL");
obj->obj_field(_tenant_state_offset); return obj->obj_field(_tenant_state_offset);
} }
// Support for com.alibaba.tenant.TenantState // Support for com.alibaba.tenant.TenantState
...@@ -3380,6 +3380,7 @@ int com_alibaba_tenant_TenantState::state_of(oop tenant_obj) { ...@@ -3380,6 +3380,7 @@ int com_alibaba_tenant_TenantState::state_of(oop tenant_obj) {
} }
ShouldNotReachHere(); ShouldNotReachHere();
return -1;
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* *
*/ */
#include "precompiled.hpp"
#include "gc_implementation/g1/g1AllocationContext.hpp" #include "gc_implementation/g1/g1AllocationContext.hpp"
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
......
...@@ -372,7 +372,7 @@ JVM_DestroyTenantAllocationContext(JNIEnv *env, jobject ignored, jlong context); ...@@ -372,7 +372,7 @@ JVM_DestroyTenantAllocationContext(JNIEnv *env, jobject ignored, jlong context);
JNIEXPORT jobject JNICALL JNIEXPORT jobject JNICALL
JVM_TenantContainerOf(JNIEnv *env, jclass tenantContainerClass, jobject obj); JVM_TenantContainerOf(JNIEnv *env, jclass tenantContainerClass, jobject obj);
JNIEXPORT long JNICALL JNIEXPORT jlong JNICALL
JVM_GetTenantOccupiedMemory(JNIEnv *env, jobject ignored, jlong context); JVM_GetTenantOccupiedMemory(JNIEnv *env, jobject ignored, jlong context);
/* /*
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
#include "precompiled.hpp"
#include "prims/tenantenv.h" #include "prims/tenantenv.h"
#include "runtime/globals.hpp" #include "runtime/globals.hpp"
......
...@@ -20,11 +20,18 @@ ...@@ -20,11 +20,18 @@
* *
*/ */
#include "precompiled.hpp"
#include "runtime/arguments_ext.hpp" #include "runtime/arguments_ext.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
void ArgumentsExt::set_tenant_flags() { void ArgumentsExt::set_tenant_flags() {
// order is critical here, please be careful // order is critical here, please be careful
#if !(defined(LINUX) && defined(AMD64))
if (TenantCpuThrottling || TenantCpuAccounting
|| TenantHeapIsolation || TenantHeapThrottling || MultiTenant) {
vm_exit_during_initialization("MultiTenant only works on Linux x64 platform");
}
#endif
// TenantHeapThrottling directly depends on TenantHeapIsolation // TenantHeapThrottling directly depends on TenantHeapIsolation
if (TenantHeapThrottling) { if (TenantHeapThrottling) {
......
...@@ -3974,11 +3974,13 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { ...@@ -3974,11 +3974,13 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
} }
} }
#if (defined(LINUX) && defined(AMD64))
if (MultiTenant && (TenantCpuThrottling || TenantCpuAccounting)) { if (MultiTenant && (TenantCpuThrottling || TenantCpuAccounting)) {
// JGroup initialization may involve complex steps // JGroup initialization may involve complex steps
// have to do that after full JVM initialization // have to do that after full JVM initialization
call_initializeJGroupClass(CHECK_0); call_initializeJGroupClass(CHECK_0);
} }
#endif
create_vm_timer.end(); create_vm_timer.end();
#ifdef ASSERT #ifdef ASSERT
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
/* /*
* @test * @test
* @requires os.family == "Linux"
* @requires os.arch == "amd64"
* @summary Test TenantContainer.containOf() to retrieve tenant container of a Java object * @summary Test TenantContainer.containOf() to retrieve tenant container of a Java object
* @library /testlibrary * @library /testlibrary
* @build TestContainerOf * @build TestContainerOf
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
/* /*
* @test * @test
* @requires os.family == "Linux"
* @requires os.arch == "amd64"
* @summary Test isolation of per-tenant Java heap space * @summary Test isolation of per-tenant Java heap space
* @library /testlibrary /testlibrary/whitebox * @library /testlibrary /testlibrary/whitebox
* @build TestHeapIsolation * @build TestHeapIsolation
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
# #
# @test TestParGCAllocatorLeak.sh # @test TestParGCAllocatorLeak.sh
# @requires os.family == "Linux"
# @requires os.arch == "amd64"
# @summary test memory leak of G1ParGCAllocator # @summary test memory leak of G1ParGCAllocator
# @run shell TestParGCAllocatorLeak.sh # @run shell TestParGCAllocatorLeak.sh
# #
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
/* /*
* @test * @test
* @requires os.family == "Linux"
* @requires os.arch == "amd64"
* @summary Test retain and reuse of TLAB * @summary Test retain and reuse of TLAB
* @library /testlibrary /testlibrary/whitebox * @library /testlibrary /testlibrary/whitebox
* @build TestPerTenantTLAB * @build TestPerTenantTLAB
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
/* /*
* @test * @test
* @requires os.family == "Linux"
* @requires os.arch == "amd64"
* @summary Test heap limit on tenant * @summary Test heap limit on tenant
* @library /testlibrary /testlibrary/whitebox * @library /testlibrary /testlibrary/whitebox
* @build TestTenantHeapLimit * @build TestTenantHeapLimit
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
# #
# @test TestTenantJVMOptions # @test TestTenantJVMOptions
# @requires os.family == "Linux"
# @requires os.arch == "amd64"
# @summary Test the dependencies of multi-tenant JVM options # @summary Test the dependencies of multi-tenant JVM options
# @run shell TestTenantJVMOptions.sh # @run shell TestTenantJVMOptions.sh
# #
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
/* /*
* @test * @test
* @requires os.family == "Linux"
* @requires os.arch == "amd64"
* @summary TestTenantMemoryMTSafe * @summary TestTenantMemoryMTSafe
* @library /testlibrary /testlibrary/whitebox * @library /testlibrary /testlibrary/whitebox
* @build TestTenantMemoryMTSafe sun.hotspot.WhiteBox * @build TestTenantMemoryMTSafe sun.hotspot.WhiteBox
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
/* /*
* @test * @test
* @requires os.family == "Linux"
* @requires os.arch == "amd64"
* @summary Verify PrintNMTStatistics with TenantHeapThrottling enabled * @summary Verify PrintNMTStatistics with TenantHeapThrottling enabled
* @library /testlibrary * @library /testlibrary
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册