Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
70b9fa2
8372464: Bump update version for OpenJDK: jdk-21.0.11
GoeLin Dec 3, 2025
70ba5d4
8368882: NPE during text drawing on machine with JP locale
Dec 3, 2025
0537043
Merge
GoeLin Dec 4, 2025
53fdc2d
8317838: java/nio/channels/Channels/SocketChannelStreams.java running…
RealCLanger Dec 5, 2025
d67317d
8114830: (fs) Files.copy fails due to interference from something els…
GoeLin Dec 6, 2025
5d8e48a
8301875: java.util.TimeZone.getSystemTimeZoneID uses C library defaul…
GoeLin Dec 6, 2025
d5dc445
6899304: java.awt.Toolkit.getScreenInsets(GraphicsConfiguration) retu…
GoeLin Dec 6, 2025
0982bdd
8372048: Performance improvement on Linux remote desktop
GoeLin Dec 6, 2025
888a112
8366128: jdk/jdk/nio/zipfs/TestPosix.java::testJarFile uses wrong file
Dec 9, 2025
6ec79e4
8336695: Update Commons BCEL to Version 6.10.0
GoeLin Dec 9, 2025
e56f65c
8343377: Performance regression in reflective invocation of native me…
GoeLin Dec 12, 2025
2d4c2aa
8333857: Test sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java…
GoeLin Dec 12, 2025
12f09b7
8345668: ZoneOffset.ofTotalSeconds performance regression
GoeLin Dec 12, 2025
0f2ffb5
8357277: Update OpenSSL library for interop tests
GoeLin Dec 12, 2025
7c99320
8354145: G1: UseCompressedOops boundary is calculated on maximum heap…
cost0much Dec 12, 2025
b17eef0
8313319: [linux] mmap should use MAP_FIXED_NOREPLACE if available
sercher Dec 15, 2025
ab298c2
8354922: ZGC: Use MAP_FIXED_NOREPLACE when reserving memory
sercher Dec 15, 2025
9f0c5be
8351000: StringBuilder getChar and putChar robustness
GoeLin Dec 17, 2025
b549a10
8372756: Mouse additional buttons and horizontal scrolling are broken…
GoeLin Dec 17, 2025
335ca2e
8372977: Unnecessary gthread-2.0 loading
GoeLin Dec 17, 2025
3267049
8370325: G1: Disallow GC for TLAB allocation
GoeLin Dec 17, 2025
9e29f47
8331431: Update to use jtreg 7.4
GoeLin Dec 18, 2025
20c7790
8347475: GTK: javax/swing/JColorChooser/Test8152419.java there are no…
GoeLin Dec 19, 2025
30f6d2a
8333386: TestAbortOnVMOperationTimeout test fails for client VM
GoeLin Dec 19, 2025
5316d69
8349351: Combine Screen Inset Tests into a Single File
GoeLin Dec 19, 2025
c3f2b28
8316274: javax/swing/ButtonGroup/TestButtonGroupFocusTraversal.java f…
GoeLin Dec 19, 2025
9a28f7e
8363950: Incorrect jtreg header in TestLayoutVsICU.java
GoeLin Dec 19, 2025
248eb54
8370579: PPC: fix inswri immediate argument order
dbriemann Dec 19, 2025
53635df
8030957: AIX: Implement OperatingSystemMXBean.getSystemCpuLoad() and …
Dec 22, 2025
7604ad6
8353755: Add a helper method to Util - findComponent()
GoeLin Dec 23, 2025
1e73d97
8366817: test/jdk/javax/net/ssl/TLSCommon/interop/JdkProcServer.java …
Dec 23, 2025
409e3a3
Merge
GoeLin Dec 24, 2025
df87be8
8334738: os::print_hex_dump should optionally print ASCII
TheRealMDoerr Dec 31, 2025
8b9dff8
8337102: JITTester: Fix breaks in static initialization blocks
kirill-shirokov Dec 31, 2025
fb32cf4
8372857: Improve debuggability of java/rmi/server/RemoteServer/AddrIn…
Jan 2, 2026
bad21fb
8368787: Error reporting: hs_err files should show instructions when …
TheRealMDoerr Jan 5, 2026
5a770f4
8354878: File Leak in CgroupSubsystemFactory::determine_type of cgrou…
jerboaa Jan 7, 2026
e6dadef
8370572: Cgroups hierarchical memory limit is not honored after JDK-8…
jerboaa Jan 7, 2026
192358d
8370966: Create regression test for the hierarchical memory limit fix…
jerboaa Jan 8, 2026
7d35866
8366694: Test JdbStopInNotificationThreadTest.java timed out after 60…
Jan 11, 2026
3812913
8314810: (fs) java/nio/file/Files/CopyInterference.java should use Te…
GoeLin Jan 13, 2026
19c61b8
8350103: Test containers/systemd/SystemdMemoryAwarenessTest.java fail…
GoeLin Jan 13, 2026
92e8113
8357380: java/lang/StringBuilder/RacingSBThreads.java times out with C1
GoeLin Jan 13, 2026
131db15
8351458: (ch) Move preClose to UnixDispatcher
Jan 13, 2026
6201b18
8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix)
Jan 13, 2026
e584b1f
8374209: [17u,21u] Backout JDK-8361748 due to JDK-8373727
MBaesken Jan 14, 2026
3d2439c
8371889: [21u] JFR: Deadlock in ThrowableTracer
rkennke Jan 15, 2026
2ce809a
8371978: tools/jar/ReproducibleJar.java fails on XFS
Jan 16, 2026
7f4d315
8342175: MemoryEaterMT fails intermittently with ExceptionInInitializ…
shipilev Jan 19, 2026
3b56281
8346962: Test CRLReadTimeout.java fails with -Xcomp on a fastdebug build
Jan 19, 2026
9cffbc3
8334670: SSLSocketOutputRecord buffer miscalculation
GoeLin Jan 20, 2026
310a042
8244336: Restrict algorithms at JCE layer
GoeLin Jan 20, 2026
76aeaea
Merge
GoeLin Jan 21, 2026
ddbdd42
8328608: Multiple NewSessionTicket support for TLS
GoeLin Jan 22, 2026
4cbf899
8348309: MultiNST tests need more debugging and timing
GoeLin Jan 22, 2026
bbd8bae
8343622: AesDkCrypto.stringToKey should not return null
GoeLin Jan 22, 2026
4ede2b7
8354057: Odd debug output in -Xlog:os+container=debug on certain systems
GoeLin Jan 22, 2026
6865d67
8355632: WhiteBox.waitForReferenceProcessing() fails assert for retur…
GoeLin Jan 22, 2026
bb8279e
8327114: Attach in Linux may have wrong behaviour when pid == ns_pid …
GoeLin Jan 22, 2026
960ec27
8341246: Test com/sun/tools/attach/PermissionTest.java fails access d…
GoeLin Jan 22, 2026
778b85b
8370636: com/sun/jdi/TwoThreadsTest.java should wait for completion o…
Jan 22, 2026
0477043
8341310: Test TestJcmdWithSideCar.java should skip ACCESS_TMP_VIA_PRO…
GoeLin Jan 22, 2026
6b878c8
8342449: reimplement: JDK-8327114 Attach in Linux may have wrong beha…
GoeLin Jan 22, 2026
ac9679b
8358077: sun.tools.attach.VirtualMachineImpl::checkCatchesAndSendQuit…
GoeLin Jan 22, 2026
1fd0172
8375530: PPC64: incorrect quick verify_method_data_pointer check caus…
dbriemann Jan 23, 2026
003f4e8
8358159: Empty mode/padding in cipher transformations
GoeLin Jan 26, 2026
a5d041f
8359388: Stricter checking for cipher transformations
GoeLin Jan 26, 2026
706f7cd
8360539: DTLS handshakes fails due to improper cookie validation logic
GoeLin Jan 26, 2026
cb2f1ec
8365972: JFR: ThreadDump and ClassLoaderStatistics events may cause b…
GoeLin Jan 26, 2026
080f26b
8372441: JFR: Improve logging of TestBackToBackSensitive
GoeLin Jan 26, 2026
4d2778a
8372321: TestBackToBackSensitive fails intermittently after JDK-8365972
GoeLin Jan 26, 2026
8ed7c23
8365526: Crash with null Symbol passed to SystemDictionary::resolve_o…
GoeLin Jan 26, 2026
a83e9d7
8374178: Missing include in systemDictionary.cpp after JDK-8365526
GoeLin Jan 26, 2026
4a328b9
8372988: Test runtime/Nestmates/membership/TestNestHostErrorWithMulti…
GoeLin Jan 26, 2026
90bfa9f
8374642: EscapeHash macro fails with GNU make 4.3 and 4.4
GoeLin Jan 26, 2026
7aaa311
8376270: [21u, 17u] Redo JDK-8361748: Enforce limits on the size of a…
GoeLin Jan 27, 2026
4a081ec
8373727: New XBM images parser regression: only the first line of the…
GoeLin Jan 27, 2026
984f421
8373525: C2: assert(_base == Long) failed: Not a Long
GoeLin Jan 27, 2026
636e07d
8371608: Jtreg test jdk/internal/vm/Continuation/Fuzz.java sometimes…
MBaesken Jan 29, 2026
2fdb8d0
8369911: Test sun/java2d/marlin/ClipShapeTest.java#CubicDoDash, #Cubi…
MBaesken Jan 29, 2026
85dbbf0
8317633: Modernize text.testlib.HexDumpReader
GoeLin Jan 29, 2026
40a0781
8075917: The regression-swing case failed as the text on label is not…
GoeLin Jan 29, 2026
153da39
8351639: Improve debuggability of test/langtools/jdk/jshell/JdiHangin…
GoeLin Jan 29, 2026
f0eabb7
8375549: ConcurrentModificationException if jdk.crypto.disabledAlgori…
GoeLin Jan 29, 2026
422784f
8375063: Update Libpng to 1.6.54
mrserb Feb 1, 2026
6dac907
8330016: Stress seed should be initialized for runtime stub compilation
Feb 2, 2026
e4f2357
8372348: Adjust some UL / JFR string deduplication output messages
MBaesken Feb 2, 2026
5ea7dd4
8345578: New test in JDK-8343622 fails with a promoted build
GoeLin Feb 3, 2026
e96b4cd
8355278: Improve debuggability of com/sun/jndi/ldap/LdapPoolTimeoutTe…
GoeLin Feb 3, 2026
2f4c955
8354219: Automate javax/swing/JComboBox/ComboPopupBug.java
GoeLin Feb 3, 2026
2ce5030
8356107: [java.lang] Use @requires tag instead of exiting based on os…
GoeLin Feb 3, 2026
1cda280
8346048: test/lib/containers/docker/DockerRunOptions.java uses addJav…
Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
version=21.0.10
version=21.0.11

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
Expand Down
4 changes: 2 additions & 2 deletions make/autoconf/lib-tests.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2024, 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
Expand Down Expand Up @@ -28,7 +28,7 @@
################################################################################

# Minimum supported versions
JTREG_MINIMUM_VERSION=7.3.1
JTREG_MINIMUM_VERSION=7.4
GTEST_MINIMUM_VERSION=1.14.0

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion make/common/Utils.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))

################################################################################
# This macro works just like EscapeDollar above, but for #.
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
EscapeHash = $(subst $(HASH),\$(HASH),$(subst \$(HASH),$(HASH),$(strip $1)))

################################################################################
# This macro translates $ into $$ to protect the string from make itself.
Expand Down
2 changes: 1 addition & 1 deletion make/conf/github-actions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Versions and download locations for dependencies used by GitHub Actions (GHA)

GTEST_VERSION=1.14.0
JTREG_VERSION=7.3.1+1
JTREG_VERSION=7.4+1

LINUX_X64_BOOT_JDK_EXT=tar.gz
LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.6%2B7/OpenJDK21U-jdk_x64_linux_hotspot_21.0.6_7.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,9 +1185,9 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "jpg",
product: "jtreg",
version: "7.3.1",
version: "7.4",
build_number: "1",
file: "bundles/jtreg-7.3.1+1.zip",
file: "bundles/jtreg-7.4+1.zip",
environment_name: "JT_HOME",
environment_path: input.get("jtreg", "home_path") + "/bin",
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
Expand Down
6 changes: 3 additions & 3 deletions make/conf/version-numbers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@

DEFAULT_VERSION_FEATURE=21
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=10
DEFAULT_VERSION_UPDATE=11
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2026-01-20
DEFAULT_VERSION_DATE=2026-04-21
DEFAULT_VERSION_CLASSFILE_MAJOR=65 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_VERSION_DOCS_API_SINCE=11
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="20 21"
DEFAULT_JDK_SOURCE_TARGET_VERSION=21
DEFAULT_PROMOTED_VERSION_PRE=
DEFAULT_PROMOTED_VERSION_PRE=ea
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1268,11 +1268,11 @@ void InterpreterMacroAssembler::verify_method_data_pointer() {
lhz(R11_scratch1, in_bytes(DataLayout::bci_offset()), R28_mdx);
ld(R12_scratch2, in_bytes(Method::const_offset()), R19_method);
addi(R11_scratch1, R11_scratch1, in_bytes(ConstMethod::codes_offset()));
add(R11_scratch1, R12_scratch2, R12_scratch2);
add(R11_scratch1, R11_scratch1, R12_scratch2);
cmpd(CCR0, R11_scratch1, R14_bcp);
beq(CCR0, verify_continue);

call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp ), R19_method, R14_bcp, R28_mdx);
call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::verify_mdp), R19_method, R14_bcp, R28_mdx);

bind(verify_continue);
#endif
Expand Down
26 changes: 13 additions & 13 deletions src/hotspot/cpu/ppc/ppc.ad
Original file line number Diff line number Diff line change
Expand Up @@ -13073,27 +13073,27 @@ instruct countTrailingZerosL_cnttzd(iRegIdst dst, iRegLsrc src) %{
%}

// Expand nodes for byte_reverse_int.
instruct insrwi_a(iRegIdst dst, iRegIsrc src, immI16 pos, immI16 shift) %{
effect(DEF dst, USE src, USE pos, USE shift);
instruct insrwi_a(iRegIdst dst, iRegIsrc src, immI16 n, immI16 b) %{
effect(DEF dst, USE src, USE n, USE b);
predicate(false);

format %{ "INSRWI $dst, $src, $pos, $shift" %}
format %{ "INSRWI $dst, $src, $n, $b" %}
size(4);
ins_encode %{
__ insrwi($dst$$Register, $src$$Register, $shift$$constant, $pos$$constant);
__ insrwi($dst$$Register, $src$$Register, $n$$constant, $b$$constant);
%}
ins_pipe(pipe_class_default);
%}

// As insrwi_a, but with USE_DEF.
instruct insrwi(iRegIdst dst, iRegIsrc src, immI16 pos, immI16 shift) %{
effect(USE_DEF dst, USE src, USE pos, USE shift);
instruct insrwi(iRegIdst dst, iRegIsrc src, immI16 n, immI16 b) %{
effect(USE_DEF dst, USE src, USE n, USE b);
predicate(false);

format %{ "INSRWI $dst, $src, $pos, $shift" %}
format %{ "INSRWI $dst, $src, $n, $b" %}
size(4);
ins_encode %{
__ insrwi($dst$$Register, $src$$Register, $shift$$constant, $pos$$constant);
__ insrwi($dst$$Register, $src$$Register, $n$$constant, $b$$constant);
%}
ins_pipe(pipe_class_default);
%}
Expand All @@ -13115,12 +13115,12 @@ instruct bytes_reverse_int_Ex(iRegIdst dst, iRegIsrc src) %{
iRegLdst tmpI3;

urShiftI_reg_imm(tmpI1, src, imm24);
insrwi_a(dst, tmpI1, imm24, imm8);
insrwi_a(dst, tmpI1, imm8, imm24);
urShiftI_reg_imm(tmpI2, src, imm16);
insrwi(dst, tmpI2, imm8, imm16);
insrwi(dst, tmpI2, imm16, imm8);
urShiftI_reg_imm(tmpI3, src, imm8);
insrwi(dst, tmpI3, imm8, imm8);
insrwi(dst, src, imm0, imm8);
insrwi(dst, src, imm8, imm0);
%}
%}

Expand Down Expand Up @@ -13238,7 +13238,7 @@ instruct bytes_reverse_ushort_Ex(iRegIdst dst, iRegIsrc src) %{
immI16 imm8 %{ (int) 8 %}

urShiftI_reg_imm(dst, src, imm8);
insrwi(dst, src, imm16, imm8);
insrwi(dst, src, imm8, imm16);
%}
%}

Expand Down Expand Up @@ -13267,7 +13267,7 @@ instruct bytes_reverse_short_Ex(iRegIdst dst, iRegIsrc src) %{
iRegLdst tmpI1;

urShiftI_reg_imm(tmpI1, src, imm8);
insrwi(tmpI1, src, imm16, imm8);
insrwi(tmpI1, src, imm8, imm16);
extsh(dst, tmpI1);
%}
%}
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/os/linux/cgroupSubsystem_linux.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, 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
Expand Down Expand Up @@ -297,6 +297,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
} else {
log_debug(os, container)("Can't read %s, %s", controllers_file, os::strerror(errno));
*flags = INVALID_CGROUPS_V2;
fclose(controllers);
return false;
}
for (int i = 0; i < CG_INFO_LENGTH; i++) {
Expand Down Expand Up @@ -357,7 +358,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
all_required_controllers_enabled = all_required_controllers_enabled && cg_infos[i]._enabled;
}
if (log_is_enabled(Debug, os, container) && !cg_infos[i]._enabled) {
log_debug(os, container)("controller %s is not enabled\n", cg_controller_name[i]);
log_debug(os, container)("controller %s is not enabled", cg_controller_name[i]);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/hotspot/os/linux/cgroupSubsystem_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@
log_trace(os, container)(log_string " is: %s", retval); \
}

#define CONTAINER_READ_NUMERICAL_KEY_VALUE_CHECKED(controller, filename, key, log_string, retval) \
{ \
bool is_ok; \
is_ok = controller->read_numerical_key_value(filename, key, &retval); \
if (!is_ok) { \
log_trace(os, container)(log_string " failed: %d", OSCONTAINER_ERROR); \
return OSCONTAINER_ERROR; \
} \
log_trace(os, container)(log_string " is: " JULONG_FORMAT, retval); \
}

class CgroupController: public CHeapObj<mtInternal> {
protected:
char* _cgroup_path;
Expand Down
29 changes: 18 additions & 11 deletions src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ void CgroupV1Controller::set_subsystem_path(const char* cgroup_path) {
}
}

jlong CgroupV1MemoryController::uses_mem_hierarchy() {
julong use_hierarchy;
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.use_hierarchy", "Use Hierarchy", use_hierarchy);
return (jlong)use_hierarchy;
}

/*
* The common case, containers, we have _root == _cgroup_path, and thus set the
* controller path to the _mount_point. This is where the limits are exposed in
Expand Down Expand Up @@ -159,13 +165,13 @@ void verbose_log(julong read_mem_limit, julong host_mem) {
jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong phys_mem) {
julong memlimit;
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.limit_in_bytes", "Memory Limit", memlimit);
if (memlimit >= phys_mem) {
verbose_log(memlimit, phys_mem);
return (jlong)-1;
} else {
verbose_log(memlimit, phys_mem);
return (jlong)memlimit;
if (memlimit >= phys_mem && uses_mem_hierarchy()) {
CONTAINER_READ_NUMERICAL_KEY_VALUE_CHECKED(reader(), "/memory.stat",
"hierarchical_memory_limit", "Hierarchical Memory Limit",
memlimit);
}
verbose_log(memlimit, phys_mem);
return (jlong)((memlimit < phys_mem) ? memlimit : -1);
}

/* read_mem_swap
Expand All @@ -183,12 +189,13 @@ jlong CgroupV1MemoryController::read_memory_limit_in_bytes(julong phys_mem) {
jlong CgroupV1MemoryController::read_mem_swap(julong host_total_memsw) {
julong memswlimit;
CONTAINER_READ_NUMBER_CHECKED(reader(), "/memory.memsw.limit_in_bytes", "Memory and Swap Limit", memswlimit);
if (memswlimit >= host_total_memsw) {
log_trace(os, container)("Memory and Swap Limit is: Unlimited");
return (jlong)-1;
} else {
return (jlong)memswlimit;
if (memswlimit >= host_total_memsw && uses_mem_hierarchy()) {
CONTAINER_READ_NUMERICAL_KEY_VALUE_CHECKED(reader(), "/memory.stat",
"hierarchical_memsw_limit", "Hierarchical Memory and Swap Limit",
memswlimit);
}
verbose_log(memswlimit, host_total_memsw);
return (jlong)((memswlimit < host_total_memsw) ? memswlimit : -1);
}

jlong CgroupV1MemoryController::memory_and_swap_limit_in_bytes(julong host_mem, julong host_swap) {
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class CgroupV1MemoryController final : public CgroupMemoryController {
const char* mount_point() override { return reader()->mount_point(); }
const char* cgroup_path() override { return reader()->cgroup_path(); }
private:
jlong uses_mem_hierarchy();
jlong read_mem_swappiness();
jlong read_mem_swap(julong host_total_memsw);

Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/os/linux/gc/x/xSyscall_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#define MPOL_F_ADDR (1<<1)
#endif

#ifndef MAP_FIXED_NOREPLACE
#define MAP_FIXED_NOREPLACE 0x100000
#endif

class XSyscall : public AllStatic {
public:
static int memfd_create(const char* name, unsigned int flags);
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/os/linux/gc/z/zSyscall_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#define MPOL_F_ADDR (1<<1)
#endif

#ifndef MAP_FIXED_NOREPLACE
#define MAP_FIXED_NOREPLACE 0x100000
#endif

class ZSyscall : public AllStatic {
public:
static int memfd_create(const char* name, unsigned int flags);
Expand Down
20 changes: 18 additions & 2 deletions src/hotspot/os/linux/os_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3550,8 +3550,23 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) {
// may not start from the requested address. Unlike Linux mmap(), this
// function returns null to indicate failure.
static char* anon_mmap(char* requested_addr, size_t bytes) {
// MAP_FIXED is intentionally left out, to leave existing mappings intact.
const int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
// If a requested address was given:
//
// The POSIX-conforming way is to *omit* MAP_FIXED. This will leave existing mappings intact.
// If the requested mapping area is blocked by a pre-existing mapping, the kernel will map
// somewhere else. On Linux, that alternative address appears to have no relation to the
// requested address.
// Unfortunately, this is not what we need - if we requested a specific address, we'd want
// to map there and nowhere else. Therefore we will unmap the block again, which means we
// just executed a needless mmap->munmap cycle.
// Since Linux 4.17, the kernel offers MAP_FIXED_NOREPLACE. With this flag, if a pre-
// existing mapping exists, the kernel will not map at an alternative point but instead
// return an error. We can therefore save that unnecessary mmap-munmap cycle.
//
// Backward compatibility: Older kernels will ignore the unknown flag; so mmap will behave
// as in mode (a).
const int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS |
((requested_addr != nullptr) ? MAP_FIXED_NOREPLACE : 0);

// Map reserved/uncommitted pages PROT_NONE so we fail early if we
// touch an uncommitted page. Otherwise, the read/write might
Expand Down Expand Up @@ -4320,6 +4335,7 @@ char* os::pd_attempt_reserve_memory_at(char* requested_addr, size_t bytes, bool

if (addr != nullptr) {
// mmap() is successful but it fails to reserve at the requested address
log_trace(os, map)("Kernel rejected " PTR_FORMAT ", offered " PTR_FORMAT ".", p2i(requested_addr), p2i(addr));
anon_munmap(addr, bytes);
}

Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/os/posix/gc/x/xVirtualMemory_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include "gc/x/xAddress.inline.hpp"
#include "gc/x/xVirtualMemory.hpp"
#include "logging/log.hpp"
#ifdef LINUX
#include "gc/x/xSyscall_linux.hpp"
#endif

#include <sys/mman.h>
#include <sys/types.h>
Expand All @@ -38,7 +41,9 @@ void XVirtualMemoryManager::pd_initialize_after_reserve() {
}

bool XVirtualMemoryManager::pd_reserve(uintptr_t addr, size_t size) {
const uintptr_t res = (uintptr_t)mmap((void*)addr, size, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
const int flags = MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE LINUX_ONLY(|MAP_FIXED_NOREPLACE);

const uintptr_t res = (uintptr_t)mmap((void*)addr, size, PROT_NONE, flags, -1, 0);
if (res == (uintptr_t)MAP_FAILED) {
// Failed to reserve memory
return false;
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/os/posix/gc/z/zVirtualMemory_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zVirtualMemory.hpp"
#include "logging/log.hpp"
#ifdef LINUX
#include "gc/z/zSyscall_linux.hpp"
#endif

#include <sys/mman.h>
#include <sys/types.h>
Expand All @@ -38,7 +41,9 @@ void ZVirtualMemoryManager::pd_initialize_after_reserve() {
}

bool ZVirtualMemoryManager::pd_reserve(zaddress_unsafe addr, size_t size) {
void* const res = mmap((void*)untype(addr), size, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
const int flags = MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE LINUX_ONLY(|MAP_FIXED_NOREPLACE);

void* const res = mmap((void*)untype(addr), size, PROT_NONE, flags, -1, 0);
if (res == MAP_FAILED) {
// Failed to reserve memory
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Microsoft Corporation. All rights reserved.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, 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
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/archiveBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ class ArchiveBuilder::CDSMapLogger : AllStatic {
// longs and doubles will be split into two words.
unitsize = sizeof(narrowOop);
}
os::print_hex_dump(&lsh, base, top, unitsize, 32, requested_base);
os::print_hex_dump(&lsh, base, top, unitsize, /* print_ascii=*/true, /* bytes_per_line=*/32, requested_base);
}
}

Expand Down
Loading
Loading