diff --git a/delete_expired_certificates.patch b/delete_expired_certificates.patch new file mode 100755 index 0000000000000000000000000000000000000000..4c2a8e4281e99418ba968308af4b20792cab422d --- /dev/null +++ b/delete_expired_certificates.patch @@ -0,0 +1,152 @@ +diff --git a/make/data/cacerts/luxtrustglobalrootca b/make/data/cacerts/luxtrustglobalrootca +deleted file mode 100644 +index 7fb3d818f..000000000 +--- a/make/data/cacerts/luxtrustglobalrootca ++++ /dev/null +@@ -1,28 +0,0 @@ +-Owner: CN=LuxTrust Global Root, O=LuxTrust s.a., C=LU +-Issuer: CN=LuxTrust Global Root, O=LuxTrust s.a., C=LU +-Serial number: bb8 +-Valid from: Thu Mar 17 09:51:37 GMT 2011 until: Wed Mar 17 09:51:37 GMT 2021 +-Signature algorithm name: SHA256withRSA +-Subject Public Key Algorithm: 2048-bit RSA key +-Version: 3 +------BEGIN CERTIFICATE----- +-MIIDZDCCAkygAwIBAgICC7gwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCTFUx +-FjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0IEdsb2Jh +-bCBSb290MB4XDTExMDMxNzA5NTEzN1oXDTIxMDMxNzA5NTEzN1owRDELMAkGA1UE +-BhMCTFUxFjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0 +-IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsn+n +-QPAiygz267Hxyw6VV0B1r6A/Ps7sqjJX5hmxZ0OYWmt8s7j6eJyqpoSyYBuAQc5j +-zR8XCJmk9e8+EsdMsFeaXHhAePxFjdqRZ9w6Ubltc+a3OY52OrQfBfVpVfmTz3iI +-Sr6qm9d7R1tGBEyCFqY19vx039a0r9jitScRdFmiwmYsaArhmIiIPIoFdRTjuK7z +-CISbasE/MRivJ6VLm6T9eTHemD0OYcqHmMH4ijCc+j4z1aXEAwfh95Z0GAAnOCfR +-K6qq4UFFi2/xJcLcopeVx0IUM115hCNq52XAV6DYXaljAeew5Ivo+MVjuOVsdJA9 +-x3f8K7p56aTGEnin/wIDAQABo2AwXjAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQE +-AwIBBjAfBgNVHSMEGDAWgBQXFYWJCS8kh28/HRvk8pZ5g0gTzjAdBgNVHQ4EFgQU +-FxWFiQkvJIdvPx0b5PKWeYNIE84wDQYJKoZIhvcNAQELBQADggEBAFrwHNDUUM9B +-fua4nX3DcNBeNv9ujnov3kgR1TQuPLdFwlQlp+HBHjeDtpSutkVIA+qVvuucarQ3 +-XB8u02uCgUNbCj8RVWOs+nwIAjegPDkEM/6XMshS5dklTbDG7mgfcKpzzlcD3H0K +-DTPy0lrfCmw7zBFRlxqkIaKFNQLXgCLShLL4wKpov9XrqsMLq6F8K/f1O4fhVFfs +-BSTveUJO84ton+Ruy4KZycwq3FPCH3CDqyEPVrRI/98HIrOM+R2mBN8tAza53W/+ +-MYhm/2xtRDSvCHc+JtJy9LtHVpM8mGPhM7uZI5K1g3noHZ9nrWLWidb2/CfeMifL +-hNp3hSGhEiE= +------END CERTIFICATE----- +diff --git a/make/data/cacerts/quovadisrootca b/make/data/cacerts/quovadisrootca +deleted file mode 100644 +index 0c195ff51..000000000 +--- a/make/data/cacerts/quovadisrootca ++++ /dev/null +@@ -1,41 +0,0 @@ +-Owner: CN=QuoVadis Root Certification Authority, OU=Root Certification Authority, O=QuoVadis Limited, C=BM +-Issuer: CN=QuoVadis Root Certification Authority, OU=Root Certification Authority, O=QuoVadis Limited, C=BM +-Serial number: 3ab6508b +-Valid from: Mon Mar 19 18:33:33 GMT 2001 until: Wed Mar 17 18:33:33 GMT 2021 +-Signature algorithm name: SHA1withRSA +-Subject Public Key Algorithm: 2048-bit RSA key +-Version: 3 +------BEGIN CERTIFICATE----- +-MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC +-TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0 +-aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0 +-aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz +-MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw +-IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR +-dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG +-9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp +-li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D +-rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ +-WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug +-F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU +-xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC +-Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv +-dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw +-ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl +-IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh +-c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy +-ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +-Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI +-KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T +-KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq +-y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p +-dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD +-VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL +-MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk +-fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8 +-7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R +-cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y +-mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW +-xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK +-SnQ2+Q== +------END CERTIFICATE----- +diff --git a/make/data/cacerts/soneraclass2ca b/make/data/cacerts/soneraclass2ca +deleted file mode 100644 +index 43faa5e21..000000000 +--- a/make/data/cacerts/soneraclass2ca ++++ /dev/null +@@ -1,26 +0,0 @@ +-Owner: CN=Sonera Class2 CA, O=Sonera, C=FI +-Issuer: CN=Sonera Class2 CA, O=Sonera, C=FI +-Serial number: 1d +-Valid from: Fri Apr 06 07:29:40 GMT 2001 until: Tue Apr 06 07:29:40 GMT 2021 +-Signature algorithm name: SHA1withRSA +-Subject Public Key Algorithm: 2048-bit RSA key +-Version: 3 +------BEGIN CERTIFICATE----- +-MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +-MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx +-MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV +-BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI +-hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o +-Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt +-5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s +-3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej +-vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu +-8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw +-DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG +-MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil +-zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ +-3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD +-FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 +-Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 +-ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M +------END CERTIFICATE----- +diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +index ec9cca01f..793376ea1 100644 +--- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java ++++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +@@ -53,12 +53,12 @@ public class VerifyCACerts { + + File.separator + "security" + File.separator + "cacerts"; + + // The numbers of certs now. +- private static final int COUNT = 89; ++ private static final int COUNT = 86; + + // SHA-256 of cacerts, can be generated with + // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 + private static final String CHECKSUM +- = "9F:6B:41:1D:05:AF:E3:C5:4F:E8:39:89:50:79:60:B1:F6:A4:02:40:0C:28:8D:73:78:08:E5:61:7C:17:EA:59"; ++ = "A5:00:71:02:B4:8B:AC:BE:64:34:0A:F2:DF:9D:F7:75:9D:05:84:7E:F6:EA:48:F0:64:36:29:8C:E7:A2:2D:63"; + + // map of cert alias to SHA-256 fingerprint + @SuppressWarnings("serial") +@@ -146,10 +146,6 @@ public class VerifyCACerts { + "5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE"); + put("letsencryptisrgx1 [jdk]", + "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6"); +- put("luxtrustglobalrootca [jdk]", +- "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50"); +- put("quovadisrootca [jdk]", +- "A4:5E:DE:3B:BB:F0:9C:8A:E1:5C:72:EF:C0:72:68:D6:93:A2:1C:99:6F:D5:1E:67:CA:07:94:60:FD:6D:88:73"); + put("quovadisrootca1g3 [jdk]", + "8A:86:6F:D1:B2:76:B5:7E:57:8E:92:1C:65:82:8A:2B:ED:58:E9:F2:F2:88:05:41:34:B7:F1:F4:BF:C9:CC:74"); + put("quovadisrootca2 [jdk]", +@@ -170,8 +166,6 @@ public class VerifyCACerts { + "3B:22:2E:56:67:11:E9:92:30:0D:C0:B1:5A:B9:47:3D:AF:DE:F8:C8:4D:0C:EF:7D:33:17:B4:C1:82:1D:14:36"); + put("swisssignsilverg2ca [jdk]", + "BE:6C:4D:A2:BB:B9:BA:59:B6:F3:93:97:68:37:42:46:C3:C0:05:99:3F:A9:8F:02:0D:1D:ED:BE:D4:8A:81:D5"); +- put("soneraclass2ca [jdk]", +- "79:08:B4:03:14:C1:38:10:0B:51:8D:07:35:80:7F:FB:FC:F8:51:8A:00:95:33:71:05:BA:38:6B:15:3D:D9:27"); + put("securetrustca [jdk]", + "F1:C1:B5:0A:E5:A2:0D:D8:03:0E:C9:F6:BC:24:82:3D:D3:67:B5:25:57:59:B4:E7:1B:61:FC:E9:F7:37:5D:73"); + put("xrampglobalca [jdk]", diff --git a/openjdk-11.spec b/openjdk-11.spec index 70f5a28b6fa0f34adb1ac8f8ef2af7cb631e6729..d08d690035f91a0bde61f68f7b9291f76044de12 100644 --- a/openjdk-11.spec +++ b/openjdk-11.spec @@ -740,7 +740,7 @@ Provides: java-src%{?1} = %{epoch}:%{version}-%{release} Name: java-%{javaver}-%{origin} Version: %{newjavaver}.%{buildver} -Release: 2 +Release: 6 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -854,6 +854,9 @@ Patch69: G1-iterate-region-by-bitmap-rather-than-obj-size-in.patch #11.0.11 Patch70: 8264640.patch Patch71: numa_mem_leak.patch +Patch72: select_nearest_numa_node.patch +Patch73: support_jmap_parallel_inspection_for_cms_gc.patch +Patch74: delete_expired_certificates.patch BuildRequires: autoconf BuildRequires: alsa-lib-devel @@ -1129,6 +1132,9 @@ pushd %{top_level_dir_name} %patch69 -p1 %patch70 -p1 %patch71 -p1 +%patch72 -p1 +%patch73 -p1 +%patch74 -p1 popd # openjdk # %patch1000 @@ -1632,6 +1638,18 @@ require "copy_jdk_configs.lua" %changelog +* Thu Jun 17 2021 Benshuai5D - 1:11.0.11.9-6 +- add openjdk-11.yaml + +* Wed Jun 9 2021 kuenking111 - 1:11.0.11.9-5 +- add delete_expired_certificates.patch + +* Wed Jun 9 2021 kuenking111 - 1:11.0.11.9-4 +- add support_jmap_parallel_inspection_for_cms_gc.patch + +* Wed Jun 9 2021 kuenking111 - 1:11.0.11.9-3 +- add select_nearest_numa_node.patch + * Mon May 31 2021 kuenking111 - 1:11.0.11.9-2 - add numa_mem_leak.patch diff --git a/openjdk-11.yaml b/openjdk-11.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6b2e68e7848be96ca12e59494a097a54c169844a --- /dev/null +++ b/openjdk-11.yaml @@ -0,0 +1,5 @@ +--- +version_control: git +src_repo: https://github.com/openjdk/jdk11u +tag_prefix: jdk- +seperator: "." diff --git a/select_nearest_numa_node.patch b/select_nearest_numa_node.patch new file mode 100755 index 0000000000000000000000000000000000000000..74e0f746a83b9526f8da1255068e8237b629675c --- /dev/null +++ b/select_nearest_numa_node.patch @@ -0,0 +1,262 @@ +diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp +index 107b89cfa..63c699641 100644 +--- a/src/hotspot/os/aix/os_aix.cpp ++++ b/src/hotspot/os/aix/os_aix.cpp +@@ -286,6 +286,9 @@ bool os::have_special_privileges() { + return privileges; + } + ++uint os::numa_distance(uint node_index, uint node_index_other) { ++ return 0; ++} + // Helper function, emulates disclaim64 using multiple 32bit disclaims + // because we cannot use disclaim64() on AS/400 and old AIX releases. + static bool my_disclaim64(char* addr, size_t size) { +diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp +index 897dec293..9587380b4 100644 +--- a/src/hotspot/os/bsd/os_bsd.cpp ++++ b/src/hotspot/os/bsd/os_bsd.cpp +@@ -216,7 +216,9 @@ bool os::have_special_privileges() { + return privileges; + } + +- ++uint os::numa_distance(uint node_index, uint node_index_other) { ++ return 0; ++} + + // Cpu architecture string + #if defined(ZERO) +diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp +index 0e99218d5..d69454eb3 100644 +--- a/src/hotspot/os/linux/os_linux.cpp ++++ b/src/hotspot/os/linux/os_linux.cpp +@@ -3101,6 +3101,9 @@ int os::numa_get_group_id_for_address(const void* address) { + return id; + } + ++uint os::numa_distance(uint node_index, uint node_index_other) { ++ return Linux::numa_distance(node_index, node_index_other); ++} + int os::Linux::get_existing_num_nodes() { + int node; + int highest_node_number = Linux::numa_max_node(); +diff --git a/src/hotspot/os/solaris/os_solaris.cpp b/src/hotspot/os/solaris/os_solaris.cpp +index 73d5d832f..e440aea91 100644 +--- a/src/hotspot/os/solaris/os_solaris.cpp ++++ b/src/hotspot/os/solaris/os_solaris.cpp +@@ -2240,6 +2240,9 @@ static void warn_fail_commit_memory(char* addr, size_t bytes, + alignment_hint, exec, os::strerror(err), err); + } + ++uint os::numa_distance(uint node_index, uint node_index_other) { ++ return 0; ++} + int os::Solaris::commit_memory_impl(char* addr, size_t bytes, bool exec) { + int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE; + size_t size = bytes; +diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp +index 0249a652e..e514817e9 100644 +--- a/src/hotspot/os/windows/os_windows.cpp ++++ b/src/hotspot/os/windows/os_windows.cpp +@@ -179,6 +179,9 @@ void os::run_periodic_checks() { + return; + } + ++uint os::numa_distance(uint node_index, uint node_index_other) { ++ return 0; ++} + // previous UnhandledExceptionFilter, if there is one + static LPTOP_LEVEL_EXCEPTION_FILTER prev_uef_handler = NULL; + +diff --git a/src/hotspot/share/gc/g1/g1NUMA.cpp b/src/hotspot/share/gc/g1/g1NUMA.cpp +index fada40f13..66c3cbe42 100644 +--- a/src/hotspot/share/gc/g1/g1NUMA.cpp ++++ b/src/hotspot/share/gc/g1/g1NUMA.cpp +@@ -63,6 +63,16 @@ const int* G1NUMA::node_ids() const { + return _node_ids; + } + ++// Returns numa distance ++const uint G1NUMA::calc_numa_node_distance(uint node_index, uint other_node_index) const { ++ if (node_index >= _num_active_node_ids || other_node_index >= _num_active_node_ids) { ++ return UINT_MAX; ++ } ++ return _numa_node_distance[node_index][other_node_index]; ++} ++bool G1NUMA::use_nearest_node() const { ++ return _use_nearest; ++} + uint G1NUMA::index_of_node_id(int node_id) const { + assert(node_id >= 0, "invalid node id %d", node_id); + assert(node_id < _len_node_id_to_index_map, "invalid node id %d", node_id); +@@ -75,7 +85,7 @@ uint G1NUMA::index_of_node_id(int node_id) const { + G1NUMA::G1NUMA() : + _node_id_to_index_map(NULL), _len_node_id_to_index_map(0), + _node_ids(NULL), _num_active_node_ids(0), +- _region_size(0), _page_size(0), _stats(NULL) { ++ _region_size(0), _page_size(0), _stats(NULL), _use_nearest(false) { + } + + void G1NUMA::initialize_without_numa() { +@@ -106,10 +116,23 @@ void G1NUMA::initialize(bool use_numa) { + for (uint i = 0; i < _num_active_node_ids; i++) { + max_node_id = MAX2(max_node_id, _node_ids[i]); + } +- ++ if (_num_active_node_ids > 2) { ++ _use_nearest = true; ++ } + // Create a mapping between node_id and index. + _len_node_id_to_index_map = max_node_id + 1; + _node_id_to_index_map = NEW_C_HEAP_ARRAY(uint, _len_node_id_to_index_map, mtGC); ++ _numa_node_distance = NEW_C_HEAP_ARRAY(uint*, _num_active_node_ids * _num_active_node_ids, mtGC); ++ // Set node disctance ++ for (uint node_i = 0; node_i < _num_active_node_ids; node_i++) { ++ _numa_node_distance[node_i] = NEW_C_HEAP_ARRAY(uint, _num_active_node_ids*_num_active_node_ids, mtGC); ++ } ++ for (uint node_i = 0; node_i < _num_active_node_ids; node_i++) { ++ for (uint node_j = 0; node_j < _num_active_node_ids; node_j++) { ++ uint distance = os::numa_distance(node_i, node_j); ++ _numa_node_distance[node_i][node_j] = distance; ++ } ++ } + + // Set all indices with unknown node id. + for (int i = 0; i < _len_node_id_to_index_map; i++) { +@@ -128,6 +151,10 @@ G1NUMA::~G1NUMA() { + delete _stats; + FREE_C_HEAP_ARRAY(int, _node_id_to_index_map); + FREE_C_HEAP_ARRAY(int, _node_ids); ++ for (uint node_i = 0; node_i < _num_active_node_ids; node_i++) { ++ FREE_C_HEAP_ARRAY(uint, _numa_node_distance[node_i]); ++ } ++ FREE_C_HEAP_ARRAY(uint*, _numa_node_distance); + } + + void G1NUMA::set_region_info(size_t region_size, size_t page_size) { +diff --git a/src/hotspot/share/gc/g1/g1NUMA.hpp b/src/hotspot/share/gc/g1/g1NUMA.hpp +index 56889057f..bde3332eb 100644 +--- a/src/hotspot/share/gc/g1/g1NUMA.hpp ++++ b/src/hotspot/share/gc/g1/g1NUMA.hpp +@@ -45,11 +45,14 @@ class G1NUMA: public CHeapObj { + int* _node_ids; + // Total number of node ids. + uint _num_active_node_ids; +- ++ // numa node distance ++ uint** _numa_node_distance; + // HeapRegion size + size_t _region_size; + // Necessary when touching memory. + size_t _page_size; ++ // Use nearest numa node ++ bool _use_nearest; + + // Stores statistic data. + G1NUMAStats* _stats; +@@ -73,7 +76,6 @@ class G1NUMA: public CHeapObj { + public: + static const uint UnknownNodeIndex = UINT_MAX; + static const uint AnyNodeIndex = UnknownNodeIndex - 1; +- + static G1NUMA* numa() { return _inst; } + + static G1NUMA* create(); +@@ -86,16 +88,17 @@ public: + + // Returns active memory node count. + uint num_active_nodes() const; ++ bool use_nearest_node() const; + + bool is_enabled() const; +- + bool is_humongous_region_enabled() const; + + int numa_id(int index) const; + + // Returns memory node ids + const int* node_ids() const; +- ++ // Returns numa distance ++ const uint calc_numa_node_distance(uint node_index, uint other_node_index) const; + // Returns node index of current calling thread. + uint index_of_current_thread() const; + +diff --git a/src/hotspot/share/gc/g1/heapRegionSet.inline.hpp b/src/hotspot/share/gc/g1/heapRegionSet.inline.hpp +index fc5c03f76..e697a3c3b 100644 +--- a/src/hotspot/share/gc/g1/heapRegionSet.inline.hpp ++++ b/src/hotspot/share/gc/g1/heapRegionSet.inline.hpp +@@ -153,8 +153,8 @@ inline HeapRegion* FreeRegionList::remove_region(bool from_head) { + return hr; + } + +-inline HeapRegion* FreeRegionList::remove_region_with_node_index(bool from_head, +- uint requested_node_index) { ++inline HeapRegion* FreeRegionList::remove_region_with_node_index( ++ bool from_head, uint requested_node_index) { + assert(UseNUMA, "Invariant"); + + const uint max_search_depth = G1NUMA::numa()->max_search_depth(); +@@ -162,26 +162,45 @@ inline HeapRegion* FreeRegionList::remove_region_with_node_index(bool from_head, + + // Find the region to use, searching from _head or _tail as requested. + size_t cur_depth = 0; ++ bool exist_region = false; ++ uint numa_distance_min = UINT_MAX; ++ HeapRegion* remote_node_region = NULL; + if (from_head) { + for (cur = _head; + cur != NULL && cur_depth < max_search_depth; + cur = cur->next(), ++cur_depth) { + if (requested_node_index == cur->node_index()) { ++ exist_region = true; + break; + } ++ if (G1NUMA::numa()->use_nearest_node()) { ++ uint distance = G1NUMA::numa()->calc_numa_node_distance(requested_node_index, cur->node_index()); ++ if (distance < numa_distance_min) { ++ remote_node_region = cur; ++ numa_distance_min = distance; ++ } ++ } + } + } else { + for (cur = _tail; + cur != NULL && cur_depth < max_search_depth; + cur = cur->prev(), ++cur_depth) { + if (requested_node_index == cur->node_index()) { ++ exist_region = true; + break; + } ++ if (G1NUMA::numa()->use_nearest_node()) { ++ uint distance = G1NUMA::numa()->calc_numa_node_distance(requested_node_index, cur->node_index()); ++ if (distance < numa_distance_min) { ++ remote_node_region = cur; ++ numa_distance_min = distance; ++ } ++ } + } + } +- +- // Didn't find a region to use. +- if (cur == NULL || cur_depth >= max_search_depth) { ++ if (G1NUMA::numa()->use_nearest_node() && !exist_region && remote_node_region != NULL) { ++ cur = remote_node_region; ++ } else if (cur == NULL || cur_depth >= max_search_depth) { + return NULL; + } + +diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp +index 86bf89ef4..c3ff246b9 100644 +--- a/src/hotspot/share/runtime/os.hpp ++++ b/src/hotspot/share/runtime/os.hpp +@@ -390,7 +390,7 @@ class os: AllStatic { + static bool numa_topology_changed(); + static int numa_get_group_id(); + static int numa_get_group_id_for_address(const void* address); +- ++ static uint numa_distance(uint node_index, uint node_index_other); + // Page manipulation + struct page_info { + size_t size; diff --git a/support_jmap_parallel_inspection_for_cms_gc.patch b/support_jmap_parallel_inspection_for_cms_gc.patch new file mode 100755 index 0000000000000000000000000000000000000000..a87ab109e17e263dc39258f8a98254561d0f3a76 --- /dev/null +++ b/support_jmap_parallel_inspection_for_cms_gc.patch @@ -0,0 +1,198 @@ +diff --git a/src/hotspot/share/gc/cms/cmsHeap.cpp b/src/hotspot/share/gc/cms/cmsHeap.cpp +index 2c70eb375..880c1db03 100644 +--- a/src/hotspot/share/gc/cms/cmsHeap.cpp ++++ b/src/hotspot/share/gc/cms/cmsHeap.cpp +@@ -264,3 +264,66 @@ GrowableArray CMSHeap::memory_pools() { + memory_pools.append(_old_pool); + return memory_pools; + } ++ ++// The CMSHeapBlockClaimer is used during parallel iteration over the heap, ++// allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these. ++// The eden and survivor spaces are treated as single blocks as it is hard to divide ++// these spaces. ++// The old space is divided into fixed-size blocks. ++class CMSHeapBlockClaimer : public StackObj { ++ size_t _claimed_index; ++ ++public: ++ static const size_t InvalidIndex = SIZE_MAX; ++ static const size_t EdenIndex = 0; ++ static const size_t SurvivorIndex = 1; ++ static const size_t NumNonOldGenClaims = 2; ++ ++ CMSHeapBlockClaimer() : _claimed_index(EdenIndex) { } ++ // Claim the block and get the block index. ++ size_t claim_and_get_block() ++ { ++ size_t block_index; ++ block_index = Atomic::add(1u, &_claimed_index) - 1; ++ size_t num_claims = CMSHeap::heap()->old_gen()->num_iterable_blocks() + NumNonOldGenClaims; ++ return block_index < num_claims ? block_index : InvalidIndex; ++ } ++}; ++ ++void CMSHeap::object_iterate_parallel(ObjectClosure *cl, CMSHeapBlockClaimer *claimer) ++{ ++ size_t block_index = claimer->claim_and_get_block(); ++ // Iterate until all blocks are claimed ++ if (block_index == CMSHeapBlockClaimer::EdenIndex) { ++ young_gen()->eden()->object_iterate(cl); ++ block_index = claimer->claim_and_get_block(); ++ } ++ if (block_index == CMSHeapBlockClaimer::SurvivorIndex) { ++ young_gen()->from()->object_iterate(cl); ++ young_gen()->to()->object_iterate(cl); ++ block_index = claimer->claim_and_get_block(); ++ } ++ while (block_index != CMSHeapBlockClaimer::InvalidIndex) { ++ old_gen()->object_iterate_block(cl, block_index - CMSHeapBlockClaimer::NumNonOldGenClaims); ++ block_index = claimer->claim_and_get_block(); ++ } ++} ++ ++class CMSParallelObjectIterator : public ParallelObjectIterator { ++private: ++ CMSHeap *_heap; ++ CMSHeapBlockClaimer _claimer; ++ ++public: ++ CMSParallelObjectIterator(uint thread_num) : _heap(CMSHeap::heap()), _claimer(){} ++ ++ virtual void object_iterate(ObjectClosure *cl, uint worker_id) ++ { ++ _heap->object_iterate_parallel(cl, &_claimer); ++ } ++}; ++ ++ParallelObjectIterator* CMSHeap::parallel_object_iterator(uint thread_num) ++{ ++ return new CMSParallelObjectIterator(thread_num); ++} +diff --git a/src/hotspot/share/gc/cms/cmsHeap.hpp b/src/hotspot/share/gc/cms/cmsHeap.hpp +index 93f177aad..e02a10c59 100644 +--- a/src/hotspot/share/gc/cms/cmsHeap.hpp ++++ b/src/hotspot/share/gc/cms/cmsHeap.hpp +@@ -34,6 +34,7 @@ + #include "utilities/growableArray.hpp" + + class CLDClosure; ++class CMSHeapBlockClaimer; + class GenCollectorPolicy; + class GCMemoryManager; + class MemoryPool; +@@ -106,6 +107,14 @@ public: + return static_cast(_old_gen); + } + ++ virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num); ++ // Iteration functions. ++ void object_iterate_parallel(ObjectClosure *cl, CMSHeapBlockClaimer *claimer); ++ virtual WorkGang* get_safepoint_workers() ++ { ++ return workers(); ++ } ++ + // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects + // allocated since the last call to save_marks in the young generation. + // The "cur" closure is applied to references in the younger generation +diff --git a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp +index 708e92c53..2ebbd638e 100644 +--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp ++++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp +@@ -2733,6 +2733,46 @@ void ConcurrentMarkSweepGeneration::shrink_free_list_by(size_t bytes) { + return; + } + ++size_t ConcurrentMarkSweepGeneration::num_iterable_blocks() const ++{ ++ return (used_stable() + CMSIterateBlockSize - 1) / CMSIterateBlockSize; ++} ++ ++void ConcurrentMarkSweepGeneration::object_iterate_block(ObjectClosure *cl, size_t block_index) ++{ ++ size_t block_word_size = CMSIterateBlockSize / HeapWordSize; ++ MemRegion span = MemRegion(cmsSpace()->bottom() + block_index * block_word_size, ++ cmsSpace()->bottom() + (block_index + 1) * block_word_size); ++ if (!span.is_empty()) { // Non-null task ++ HeapWord *prev_obj; ++ if (block_index == 0) { ++ prev_obj = span.start(); ++ } else { ++ prev_obj = cmsSpace()->block_start_careful(span.start()); ++ while (prev_obj < span.start()) { ++ size_t sz = cmsSpace()->block_size_no_stall(prev_obj, _collector); ++ if (sz > 0) { ++ prev_obj += sz; ++ } else { ++ break; ++ } ++ } ++ } ++ if (prev_obj < span.end()) { ++ HeapWord *cur, *limit; ++ size_t curSize; ++ for (cur = prev_obj, limit =span.end(); cur < limit; cur += curSize) { ++ curSize = cmsSpace()->block_size_no_stall(cur, _collector); ++ if (curSize == 0) { ++ break; ++ } ++ if (cmsSpace()->block_is_obj(cur)) { ++ cl->do_object(oop(cur)); ++ } ++ } ++ } ++ } ++} + + // Simple ctor/dtor wrapper for accounting & timer chores around concurrent + // phases. +diff --git a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp +index 4f272394b..9e93fefac 100644 +--- a/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp ++++ b/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp +@@ -1010,6 +1010,9 @@ class ConcurrentMarkSweepGeneration: public CardGeneration { + // Words directly allocated, used by CMSStats. + size_t _direct_allocated_words; + ++ //CMS Parallel iterate block size ++ static const size_t CMSIterateBlockSize = 1024 * 1024; ++ + // Non-product stat counters + NOT_PRODUCT( + size_t _numObjectsPromoted; +@@ -1091,6 +1094,9 @@ class ConcurrentMarkSweepGeneration: public CardGeneration { + + void set_did_compact(bool v) { _did_compact = v; } + ++ virtual size_t num_iterable_blocks() const; ++ virtual void object_iterate_block(ObjectClosure *cl, size_t block_index); ++ + bool refs_discovery_is_atomic() const { return false; } + bool refs_discovery_is_mt() const { + // Note: CMS does MT-discovery during the parallel-remark +diff --git a/test/jdk/sun/tools/jmap/BasicJMapTest.java b/test/jdk/sun/tools/jmap/BasicJMapTest.java +index 960705e24..f87774f93 100644 +--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java ++++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java +@@ -74,6 +74,20 @@ import jdk.testlibrary.ProcessTools; + * @run main/othervm/timeout=240 -XX:+UseG1GC BasicJMapTest + */ + ++/* ++ * @test id=CMS ++ * @summary Unit test for jmap utility (CMS GC) ++ * @key intermittent ++ * @library /lib/testlibrary ++ * @library /test/lib ++ * @build jdk.testlibrary.* ++ * @build jdk.test.lib.hprof.* ++ * @build jdk.test.lib.hprof.model.* ++ * @build jdk.test.lib.hprof.parser.* ++ * @build jdk.test.lib.hprof.util.* ++ * @run main/othervm/timeout=240 -XX:+UseConcMarkSweepGC BasicJMapTest ++ */ ++ + public class BasicJMapTest { + + private static ProcessBuilder processBuilder = new ProcessBuilder();