Tue, 25 Jan 2011 17:58:19 -0500
7014261: G1: RSet-related failures
Summary: A race between the concurrent cleanup thread and the VM thread while it is processing the "expanded sparse table list" causes both threads to try to free the same sparse table entry and either causes one of the threads to fail or leaves the entry in an inconsistent state. The solution is purge all entries on the expanded list that correspond go regions that are being cleaned up.
Reviewed-by: brutisso, johnc
duke@435 | 1 | # |
trims@1907 | 2 | # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | # |
duke@435 | 5 | # This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | # under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | # published by the Free Software Foundation. |
duke@435 | 8 | # |
duke@435 | 9 | # This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | # version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | # accompanied this code). |
duke@435 | 14 | # |
duke@435 | 15 | # You should have received a copy of the GNU General Public License version |
duke@435 | 16 | # 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | # |
trims@1907 | 19 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | # or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | # questions. |
duke@435 | 22 | # |
duke@435 | 23 | # |
duke@435 | 24 | |
duke@435 | 25 | # The common definitions for hotspot builds. |
duke@435 | 26 | |
duke@435 | 27 | # Default to verbose build logs (show all compile lines): |
duke@435 | 28 | MAKE_VERBOSE=y |
duke@435 | 29 | |
duke@435 | 30 | # Make macros for install files or preparing targets |
duke@435 | 31 | CD=cd |
duke@435 | 32 | CP=cp |
duke@435 | 33 | ECHO=echo |
duke@435 | 34 | GREP=grep |
duke@435 | 35 | MKDIR=mkdir |
duke@435 | 36 | MV=mv |
duke@435 | 37 | PWD=pwd |
duke@435 | 38 | RM=rm -f |
duke@435 | 39 | SED=sed |
duke@435 | 40 | TAR=tar |
duke@435 | 41 | ZIPEXE=zip |
duke@435 | 42 | |
duke@435 | 43 | define install-file |
duke@435 | 44 | @$(MKDIR) -p $(@D) |
duke@435 | 45 | @$(RM) $@ |
duke@435 | 46 | $(CP) $< $@ |
duke@435 | 47 | endef |
duke@435 | 48 | define prep-target |
duke@435 | 49 | @$(MKDIR) -p $(@D) |
duke@435 | 50 | @$(RM) $@ |
duke@435 | 51 | endef |
duke@435 | 52 | |
duke@435 | 53 | # Directory paths and user name |
duke@435 | 54 | # Unless GAMMADIR is set on the command line, search upward from |
duke@435 | 55 | # the current directory for a parent directory containing "src/share/vm". |
duke@435 | 56 | # If that fails, look for $GAMMADIR in the environment. |
duke@435 | 57 | # When the tree of subdirs is built, this setting is stored in each flags.make. |
duke@435 | 58 | GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done) |
duke@435 | 59 | HS_SRC_DIR=$(GAMMADIR)/src |
kamg@526 | 60 | HS_MAKE_DIR=$(GAMMADIR)/make |
duke@435 | 61 | HS_BUILD_DIR=$(GAMMADIR)/build |
duke@435 | 62 | |
duke@435 | 63 | ifeq ($(USER),) |
duke@435 | 64 | USER=$(USERNAME) |
duke@435 | 65 | endif |
duke@435 | 66 | |
duke@435 | 67 | # hotspot version definitions |
duke@435 | 68 | include $(GAMMADIR)/make/hotspot_version |
duke@435 | 69 | |
duke@435 | 70 | # Java versions needed |
duke@435 | 71 | ifeq ($(PREVIOUS_JDK_VERSION),) |
duke@435 | 72 | PREVIOUS_JDK_VERSION=$(JDK_PREVIOUS_VERSION) |
duke@435 | 73 | endif |
duke@435 | 74 | ifeq ($(JDK_MAJOR_VERSION),) |
duke@435 | 75 | JDK_MAJOR_VERSION=$(JDK_MAJOR_VER) |
duke@435 | 76 | endif |
duke@435 | 77 | ifeq ($(JDK_MINOR_VERSION),) |
duke@435 | 78 | JDK_MINOR_VERSION=$(JDK_MINOR_VER) |
duke@435 | 79 | endif |
duke@435 | 80 | ifeq ($(JDK_MICRO_VERSION),) |
duke@435 | 81 | JDK_MICRO_VERSION=$(JDK_MICRO_VER) |
duke@435 | 82 | endif |
duke@435 | 83 | ifeq ($(JDK_MKTG_VERSION),) |
duke@435 | 84 | JDK_MKTG_VERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) |
duke@435 | 85 | endif |
duke@435 | 86 | ifeq ($(JDK_VERSION),) |
duke@435 | 87 | JDK_VERSION=$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) |
duke@435 | 88 | endif |
duke@435 | 89 | ifeq ($(FULL_VERSION),) |
duke@435 | 90 | FULL_VERSION="$(JDK_VERSION)" |
duke@435 | 91 | endif |
duke@435 | 92 | |
duke@435 | 93 | # FULL_VERSION is only used to define JRE_RELEASE_VERSION which is used |
duke@435 | 94 | # as JRE version in VM -Xinternalversion output. |
duke@435 | 95 | ifndef JRE_RELEASE_VERSION |
duke@435 | 96 | JRE_RELEASE_VERSION=$(FULL_VERSION) |
duke@435 | 97 | endif |
duke@435 | 98 | |
duke@435 | 99 | ifndef HOTSPOT_RELEASE_VERSION |
duke@435 | 100 | HOTSPOT_RELEASE_VERSION=$(HS_MAJOR_VER).$(HS_MINOR_VER)-b$(HS_BUILD_NUMBER) |
duke@435 | 101 | endif |
duke@435 | 102 | |
duke@435 | 103 | ifdef HOTSPOT_BUILD_VERSION |
ohair@2319 | 104 | # specified in command line |
duke@435 | 105 | else |
ohair@2319 | 106 | ifdef COOKED_BUILD_NUMBER |
ohair@2319 | 107 | # JRE build |
ohair@2319 | 108 | HOTSPOT_BUILD_VERSION= |
duke@435 | 109 | else |
ohair@2319 | 110 | ifdef USER_RELEASE_SUFFIX |
ohair@2319 | 111 | HOTSPOT_BUILD_VERSION=internal-$(USER_RELEASE_SUFFIX) |
duke@435 | 112 | else |
duke@435 | 113 | HOTSPOT_BUILD_VERSION=internal |
duke@435 | 114 | endif |
duke@435 | 115 | endif |
duke@435 | 116 | endif |
duke@435 | 117 | |
duke@435 | 118 | # Windows should have OS predefined |
duke@435 | 119 | ifeq ($(OS),) |
duke@435 | 120 | OS := $(shell uname -s) |
duke@435 | 121 | HOST := $(shell uname -n) |
duke@435 | 122 | endif |
duke@435 | 123 | |
duke@435 | 124 | # If not SunOS and not Linux, assume Windows |
duke@435 | 125 | ifneq ($(OS), Linux) |
duke@435 | 126 | ifneq ($(OS), SunOS) |
duke@435 | 127 | OSNAME=windows |
duke@435 | 128 | else |
duke@435 | 129 | OSNAME=solaris |
duke@435 | 130 | endif |
duke@435 | 131 | else |
duke@435 | 132 | OSNAME=linux |
duke@435 | 133 | endif |
duke@435 | 134 | |
duke@435 | 135 | # Determinations of default make arguments and platform specific settings |
duke@435 | 136 | MAKE_ARGS= |
duke@435 | 137 | |
duke@435 | 138 | # ARCH_DATA_MODEL==64 is equivalent to LP64=1 |
duke@435 | 139 | ifeq ($(ARCH_DATA_MODEL), 64) |
duke@435 | 140 | ifndef LP64 |
duke@435 | 141 | LP64 := 1 |
duke@435 | 142 | endif |
duke@435 | 143 | endif |
duke@435 | 144 | |
duke@435 | 145 | # Defaults set for product build |
duke@435 | 146 | EXPORT_SUBDIR= |
duke@435 | 147 | |
duke@435 | 148 | # Change default /java path if requested |
duke@435 | 149 | ifneq ($(ALT_SLASH_JAVA),) |
duke@435 | 150 | SLASH_JAVA=$(ALT_SLASH_JAVA) |
duke@435 | 151 | endif |
duke@435 | 152 | |
duke@435 | 153 | # Default OUTPUTDIR |
duke@435 | 154 | OUTPUTDIR=$(HS_BUILD_DIR)/$(OSNAME) |
duke@435 | 155 | ifneq ($(ALT_OUTPUTDIR),) |
duke@435 | 156 | OUTPUTDIR=$(ALT_OUTPUTDIR) |
duke@435 | 157 | endif |
duke@435 | 158 | |
duke@435 | 159 | # Find latest promoted JDK area |
duke@435 | 160 | JDK_IMPORT_PATH=$(SLASH_JAVA)/re/j2se/$(JDK_VERSION)/promoted/latest/binaries/$(PLATFORM) |
duke@435 | 161 | ifneq ($(ALT_JDK_IMPORT_PATH),) |
duke@435 | 162 | JDK_IMPORT_PATH=$(ALT_JDK_IMPORT_PATH) |
duke@435 | 163 | endif |
duke@435 | 164 | |
duke@435 | 165 | # Find JDK used for javac compiles |
duke@435 | 166 | BOOTDIR=$(SLASH_JAVA)/re/j2se/$(PREVIOUS_JDK_VERSION)/latest/binaries/$(PLATFORM) |
duke@435 | 167 | ifneq ($(ALT_BOOTDIR),) |
duke@435 | 168 | BOOTDIR=$(ALT_BOOTDIR) |
duke@435 | 169 | endif |
duke@435 | 170 | |
duke@435 | 171 | # The platform dependent defs.make defines platform specific variable such |
duke@435 | 172 | # as ARCH, EXPORT_LIST etc. We must place the include here after BOOTDIR is defined. |
kamg@526 | 173 | include $(GAMMADIR)/make/$(OSNAME)/makefiles/defs.make |
duke@435 | 174 | |
duke@435 | 175 | # We are trying to put platform specific defintions |
kamg@526 | 176 | # files to make/$(OSNAME)/makefiles dictory. However |
duke@435 | 177 | # some definitions are common for both linux and solaris, |
duke@435 | 178 | # so we put them here. |
duke@435 | 179 | ifneq ($(OSNAME),windows) |
kamg@526 | 180 | ABS_OUTPUTDIR := $(shell mkdir -p $(OUTPUTDIR); $(CD) $(OUTPUTDIR); $(PWD)) |
duke@435 | 181 | ABS_BOOTDIR := $(shell $(CD) $(BOOTDIR); $(PWD)) |
duke@435 | 182 | ABS_GAMMADIR := $(shell $(CD) $(GAMMADIR); $(PWD)) |
kamg@526 | 183 | ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME); $(PWD))/Makefile |
duke@435 | 184 | |
duke@435 | 185 | # uname, HotSpot source directory, build directory and JDK use different names |
duke@435 | 186 | # for CPU architectures. |
duke@435 | 187 | # ARCH - uname output |
duke@435 | 188 | # SRCARCH - where to find HotSpot cpu and os_cpu source files |
duke@435 | 189 | # BUILDARCH - build directory |
duke@435 | 190 | # LIBARCH - directory name in JDK/JRE |
duke@435 | 191 | |
duke@435 | 192 | # Use uname output for SRCARCH, but deal with platform differences. If ARCH |
duke@435 | 193 | # is not explicitly listed below, it is treated as x86. |
bobv@2036 | 194 | SRCARCH = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH))) |
duke@435 | 195 | ARCH/ = x86 |
duke@435 | 196 | ARCH/sparc = sparc |
duke@435 | 197 | ARCH/sparc64= sparc |
duke@435 | 198 | ARCH/ia64 = ia64 |
duke@435 | 199 | ARCH/amd64 = x86 |
duke@435 | 200 | ARCH/x86_64 = x86 |
bobv@2036 | 201 | ARCH/ppc64 = ppc |
bobv@2036 | 202 | ARCH/ppc = ppc |
bobv@2036 | 203 | ARCH/arm = arm |
never@1445 | 204 | ARCH/zero = zero |
duke@435 | 205 | |
duke@435 | 206 | # BUILDARCH is usually the same as SRCARCH, except for sparcv9 |
duke@435 | 207 | BUILDARCH = $(SRCARCH) |
duke@435 | 208 | ifeq ($(BUILDARCH), x86) |
duke@435 | 209 | ifdef LP64 |
duke@435 | 210 | BUILDARCH = amd64 |
duke@435 | 211 | else |
duke@435 | 212 | BUILDARCH = i486 |
duke@435 | 213 | endif |
duke@435 | 214 | endif |
duke@435 | 215 | ifeq ($(BUILDARCH), sparc) |
duke@435 | 216 | ifdef LP64 |
duke@435 | 217 | BUILDARCH = sparcv9 |
duke@435 | 218 | endif |
duke@435 | 219 | endif |
duke@435 | 220 | |
duke@435 | 221 | # LIBARCH is 1:1 mapping from BUILDARCH |
duke@435 | 222 | LIBARCH = $(LIBARCH/$(BUILDARCH)) |
duke@435 | 223 | LIBARCH/i486 = i386 |
duke@435 | 224 | LIBARCH/amd64 = amd64 |
duke@435 | 225 | LIBARCH/sparc = sparc |
duke@435 | 226 | LIBARCH/sparcv9 = sparcv9 |
duke@435 | 227 | LIBARCH/ia64 = ia64 |
bobv@2036 | 228 | LIBARCH/ppc64 = ppc |
bobv@2036 | 229 | LIBARCH/ppc = ppc |
bobv@2036 | 230 | LIBARCH/arm = arm |
never@1445 | 231 | LIBARCH/zero = $(ZERO_LIBARCH) |
duke@435 | 232 | |
never@1445 | 233 | LP64_ARCH = sparcv9 amd64 ia64 zero |
duke@435 | 234 | endif |
duke@435 | 235 | |
duke@435 | 236 | # Required make macro settings for all platforms |
duke@435 | 237 | MAKE_ARGS += JAVA_HOME=$(ABS_BOOTDIR) |
xlu@663 | 238 | MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR) |
duke@435 | 239 | MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR) |
duke@435 | 240 | MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE) |
duke@435 | 241 | MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) |
duke@435 | 242 | MAKE_ARGS += JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) |
duke@435 | 243 | |
duke@435 | 244 | # Pass HOTSPOT_BUILD_VERSION as argument to OS specific Makefile |
duke@435 | 245 | # to overwrite the default definition since OS specific Makefile also |
duke@435 | 246 | # includes this make/defs.make file. |
duke@435 | 247 | MAKE_ARGS += HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) |
duke@435 | 248 | |
duke@435 | 249 | # Select name of export directory |
duke@435 | 250 | EXPORT_PATH=$(OUTPUTDIR)/export-$(PLATFORM)$(EXPORT_SUBDIR) |
duke@435 | 251 | ifneq ($(ALT_EXPORT_PATH),) |
duke@435 | 252 | EXPORT_PATH=$(ALT_EXPORT_PATH) |
duke@435 | 253 | endif |
duke@435 | 254 | |
duke@435 | 255 | # Default jdk image if one is created for you with create_jdk |
duke@435 | 256 | JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-$(PLATFORM) |
duke@435 | 257 | |
duke@435 | 258 | # Various export sub directories |
duke@435 | 259 | EXPORT_INCLUDE_DIR = $(EXPORT_PATH)/include |
duke@435 | 260 | EXPORT_DOCS_DIR = $(EXPORT_PATH)/docs |
duke@435 | 261 | EXPORT_LIB_DIR = $(EXPORT_PATH)/lib |
duke@435 | 262 | EXPORT_JRE_DIR = $(EXPORT_PATH)/jre |
duke@435 | 263 | EXPORT_JRE_BIN_DIR = $(EXPORT_JRE_DIR)/bin |
duke@435 | 264 | EXPORT_JRE_LIB_DIR = $(EXPORT_JRE_DIR)/lib |
duke@435 | 265 | EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH) |
duke@435 | 266 | |
duke@435 | 267 | # Common export list of files |
duke@435 | 268 | EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h |
dcubed@1619 | 269 | EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h |
duke@435 | 270 | EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h |
duke@435 | 271 | EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h |
duke@435 | 272 | EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h |