From 88236263dcea96dd0cb33c15367ce6e755a949e9 Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Wed, 31 May 2023 08:53:47 +0000 Subject: [PATCH] 8309048: Remove malloc locker test case Reviewed-by: dholmes, tschatzl, coleenp, lmesnik --- make/test/JtregNativeHotspot.gmk | 7 --- test/hotspot/jtreg/TEST.quick-groups | 3 +- .../lock/malloc/malloclock01/TEST.properties | 23 -------- .../malloc/malloclock01/TestDescription.java | 38 ------------- .../nsk/share/gc/lock/LockerUtils.java | 3 - .../nsk/share/gc/lock/malloc/MallocLocker.cpp | 51 ----------------- .../share/gc/lock/malloc/MallocLocker.java | 57 ------------------- .../share/gc/lock/malloc/MallocLockers.java | 34 ----------- .../share/gc/lock/malloc/libMallocLocker.cpp | 26 --------- 9 files changed, 1 insertion(+), 241 deletions(-) delete mode 100644 test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TEST.properties delete mode 100644 test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TestDescription.java delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.cpp delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.java delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLockers.java delete mode 100644 test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/libMallocLocker.cpp diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index bfc32960f64..5d998a4d4b1 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -99,11 +99,6 @@ NSK_GC_LOCK_JVMTI_INCLUDES := \ -I$(VM_TESTBASE_DIR)/nsk/share/native \ -I$(VM_TESTBASE_DIR)/nsk/share/jni -NSK_GC_LOCK_MALLOC_INCLUDES := \ - -I$(VM_TESTBASE_DIR)/nsk/share/gc/lock/malloc \ - -I$(VM_TESTBASE_DIR)/nsk/share/native \ - -I$(VM_TESTBASE_DIR)/nsk/share/jni - NSK_GC_LOCK_JNI_INCLUDES := \ -I$(VM_TESTBASE_DIR)/nsk/share/gc/lock/jni \ -I$(VM_TESTBASE_DIR)/nsk/share/native \ @@ -179,8 +174,6 @@ BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libnativeAndMH := $(MLVM_STRESS_INCLUDES) BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libJVMTIAllocLocker := $(NSK_GC_LOCK_JVMTI_INCLUDES) -BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libMallocLocker := $(NSK_GC_LOCK_MALLOC_INCLUDES) - BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libBooleanArrayCriticalLocker := $(NSK_GC_LOCK_JNI_INCLUDES) BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libByteArrayCriticalLocker := $(NSK_GC_LOCK_JNI_INCLUDES) BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libCharArrayCriticalLocker := $(NSK_GC_LOCK_JNI_INCLUDES) diff --git a/test/hotspot/jtreg/TEST.quick-groups b/test/hotspot/jtreg/TEST.quick-groups index ddf8a1ad408..7cfb8edd8b4 100644 --- a/test/hotspot/jtreg/TEST.quick-groups +++ b/test/hotspot/jtreg/TEST.quick-groups @@ -1492,8 +1492,7 @@ vmTestbase_vm_gc_quick = \ vmTestbase/gc/gctests/ReferencesGC/ReferencesGC.java \ vmTestbase/gc/lock/jni/jnilock001/TestDescription.java \ vmTestbase/gc/lock/jniref/jnireflock01/TestDescription.java \ - vmTestbase/gc/lock/jvmti/alloc/jvmtialloclock01/TestDescription.java \ - vmTestbase/gc/lock/malloc/malloclock01/TestDescription.java + vmTestbase/gc/lock/jvmti/alloc/jvmtialloclock01/TestDescription.java vmTestbase_vm_compiler_quick = \ vmTestbase/vm/compiler/jbe/constprop/constprop01/constprop01.java \ diff --git a/test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TEST.properties b/test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TEST.properties deleted file mode 100644 index 04b22a107ac..00000000000 --- a/test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TEST.properties +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -exclusiveAccess.dirs=. diff --git a/test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TestDescription.java b/test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TestDescription.java deleted file mode 100644 index 47663fe6c93..00000000000 --- a/test/hotspot/jtreg/vmTestbase/gc/lock/malloc/malloclock01/TestDescription.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * @test - * @key stress randomness - * - * @summary converted from VM Testbase gc/lock/malloc/malloclock01. - * VM Testbase keywords: [gc, stress, stressopt, nonconcurrent] - * - * @library /vmTestbase - * /test/lib - * @build jdk.test.whitebox.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run main/othervm/native -Xbootclasspath/a:. -Xlog:gc=debug:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI gc.lock.LockerTest -lockers malloc -t 1 - */ - diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/LockerUtils.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/LockerUtils.java index 503479a25ca..77185e70b5a 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/LockerUtils.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/LockerUtils.java @@ -25,7 +25,6 @@ package nsk.share.gc.lock; import nsk.share.TestBug; import nsk.share.gc.lock.jni.JNILockers; -import nsk.share.gc.lock.malloc.MallocLockers; import nsk.share.gc.lock.jvmti.JVMTIAllocLockers; import nsk.share.gc.lock.jniref.*; @@ -52,8 +51,6 @@ public class LockerUtils { return new JNIRefLockers(); else if (id.equals("jniWeakGlobalRef")) return new JNIWeakGlobalRefLockers(); - else if (id.equals("malloc")) - return new MallocLockers(); else if (id.equals("jvmtiAlloc")) return new JVMTIAllocLockers(); else diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.cpp deleted file mode 100644 index 76ade43bbaf..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -#include -#include -#include -#include "jni_tools.h" - -extern "C" { - -/* - * Class: nsk_share_gc_lock_malloc_MallocLocker - * Method: mallocSection - * Signature: (JJ)V - */ -JNIEXPORT void JNICALL Java_nsk_share_gc_lock_malloc_MallocLocker_mallocSection -(JNIEnv *env, jobject o, jlong enterTime, jlong sleepTime) { - void *ptr; - time_t current_time, old_time; - old_time = time(NULL); - enterTime /= 1000; - current_time = 0; - while (current_time - old_time < enterTime) { - ptr = malloc(1); - mssleep((long) sleepTime); - free(ptr); - mssleep((long) sleepTime); - current_time = time(NULL); - } -} - -} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.java deleted file mode 100644 index 12426c42a8b..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLocker.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package nsk.share.gc.lock.malloc; - -import nsk.share.TestBug; -import nsk.share.gc.lock.Locker; -import nsk.share.gc.lock.CriticalSectionTimedLocker; - -/** - * Malloc locker tries to hold malloc lock (if there is any) - * by calling malloc() and free() in a loop. - */ -public class MallocLocker extends CriticalSectionTimedLocker { - static { - System.loadLibrary("MallocLocker"); - } - - public MallocLocker() { - } - - public MallocLocker(long enterTime, long sleepTime) { - super(enterTime, sleepTime); - } - - /** - * This native method does malloc() / free() in a loop - * while java field locked is set to true, sleeping - * for sleepTime between malloc() and free() and after - * free(). - */ - private native void mallocSection(long enterTime, long sleepTime); - - protected void criticalSection(long enterTime, long sleepTime) { - mallocSection(enterTime, sleepTime); - } -} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLockers.java b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLockers.java deleted file mode 100644 index 91874d540b8..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/MallocLockers.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package nsk.share.gc.lock.malloc; - -import nsk.share.TestBug; -import nsk.share.gc.lock.Lockers; -import nsk.share.gc.lock.Locker; - -public class MallocLockers implements Lockers { - public Locker createLocker(Object obj) { - return new MallocLocker(); - } -} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/libMallocLocker.cpp b/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/libMallocLocker.cpp deleted file mode 100644 index f6df5bc238c..00000000000 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/gc/lock/malloc/libMallocLocker.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "MallocLocker.cpp" -#include "jni_tools.cpp" -#include "nsk_tools.cpp"