Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Zhengyu Gu
On Thu, 22 Jul 2021 14:58:47 GMT, Thomas Stuefe wrote: > Short: this patch makes NMT available in custom-launcher scenarios and during > gtests. It simplifies NMT initialization. It adds a lot of NMT-specific > testing, cleans them up and makes them sideeffect-free. > > - > > NMT

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Fri, 30 Jul 2021 18:28:44 GMT, Zhengyu Gu wrote: >> So, you are saying that there is no memory that is malloc'd pre-NMT-init >> phase and freed post-NMT-init phase? > > Okay, I see. It just leaks those memory, so the table can be read-only. Exactly. There are a few allocs that either get

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Zhengyu Gu
On Fri, 30 Jul 2021 16:36:41 GMT, Thomas Stuefe wrote: >> src/hotspot/share/services/nmtPreInit.hpp line 309: >> >>> 307: ::memcpy(p_new, a->payload(), MIN2(a->size, new_size)); >>> 308: (*rc) = p_new; >>> 309: _num_reallocs_pre_to_post++; >> >> post-NMT-init counter

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Zhengyu Gu
On Fri, 30 Jul 2021 16:33:17 GMT, Zhengyu Gu wrote: >> The code is implicitly thread-safe because the hashmap is only modified in >> the pre-NMT-init phase. After NMT initialization, the table is read-only. >> During pre-NMT-init we are effectively single-threaded - at most two threads >>

Re: RFR: 8251329: (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside [v6]

2021-07-30 Thread Lance Andersen
> Hi, > > As discussed in the > https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-July/079621.html > thread, this is the revised patch to address the use of '.' and '..' within > Zip FS > > Zip FS needs to use "." and ".." as links to the current and parent > directories and cannot

Re: RFR: 8251329: (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside [v5]

2021-07-30 Thread Naoto Sato
On Fri, 30 Jul 2021 15:43:52 GMT, Lance Andersen wrote: >> Hi, >> >> As discussed in the >> https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-July/079621.html >> thread, this is the revised patch to address the use of '.' and '..' within >> Zip FS >> >> Zip FS needs to use "." and

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Zhengyu Gu
On Fri, 30 Jul 2021 16:28:54 GMT, Thomas Stuefe wrote: >> src/hotspot/share/services/nmtPreInit.hpp line 202: >> >>> 200: assert((*aa) != NULL, "Entry not found: " PTR_FORMAT, p2i(p)); >>> 201: NMTPreInitAllocation* a = (*aa); >>> 202: (*aa) = (*aa)->next; // remove from its

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Fri, 30 Jul 2021 13:03:32 GMT, Zhengyu Gu wrote: > Sorry for late review. > > Did a quick scan and have a few questions, will do more detail reading later. Thanks a lot, I appreciate your feedback! > src/hotspot/share/services/nmtPreInit.hpp line 108: > >> 106: // - lookup speed is

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Fri, 30 Jul 2021 12:56:59 GMT, Zhengyu Gu wrote: >> Short: this patch makes NMT available in custom-launcher scenarios and >> during gtests. It simplifies NMT initialization. It adds a lot of >> NMT-specific testing, cleans them up and makes them sideeffect-free. >> >> - >> >> NMT

Integrated: 8270321: Startup regressions in 18-b5 caused by JDK-8266310

2021-07-30 Thread Sergey Chernyshev
On Fri, 23 Jul 2021 18:03:31 GMT, Sergey Chernyshev wrote: > Dear colleagues, > > Please review the patch that replaces the lambdas with anonymous classes > which solves the startup time regression as shown below. > > I attached the Bytestacks flamegraphs for both original (regression) and

Re: RFR: 8251329: (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside [v3]

2021-07-30 Thread Lance Andersen
On Fri, 30 Jul 2021 11:24:37 GMT, Alan Bateman wrote: >> src/jdk.zipfs/share/classes/module-info.java line 49: >> >>> 47: * >>> 48: * @implNote The Zip File System will throw a ZipException when opening >>> an >>> 49: * existing Zip file that contains Zip entries with "." or ".." in its

Re: RFR: 8251329: (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside [v5]

2021-07-30 Thread Lance Andersen
> Hi, > > As discussed in the > https://mail.openjdk.java.net/pipermail/core-libs-dev/2021-July/079621.html > thread, this is the revised patch to address the use of '.' and '..' within > Zip FS > > Zip FS needs to use "." and ".." as links to the current and parent > directories and cannot

Re: [jdk17] RFR: 8067223: [TESTBUG] Rename Whitebox API package

2021-07-30 Thread Igor Ignatyev
On Thu, 29 Jul 2021 01:30:37 GMT, Vladimir Kozlov wrote: >> Hi all, >> >> could you please review this big tedious and trivial(-ish) patch which moves >> `sun.hotspot.WhiteBox` and related classes to `jdk.test.whitebox` package? >> >> the majority of the patch is the following substitutions:

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Zhengyu Gu
On Thu, 22 Jul 2021 14:58:47 GMT, Thomas Stuefe wrote: > Short: this patch makes NMT available in custom-launcher scenarios and during > gtests. It simplifies NMT initialization. It adds a lot of NMT-specific > testing, cleans them up and makes them sideeffect-free. > > - > > NMT

Re: RFR: 8270321: Startup regressions in 18-b5 caused by JDK-8266310

2021-07-30 Thread Aleksei Voitylov
On Fri, 23 Jul 2021 18:03:31 GMT, Sergey Chernyshev wrote: > Dear colleagues, > > Please review the patch that replaces the lambdas with anonymous classes > which solves the startup time regression as shown below. > > I attached the Bytestacks flamegraphs for both original (regression) and

Re: RFR: 8265891: (ch) InputStream returned by Channels.newInputStream should override transferTo [v6]

2021-07-30 Thread Alan Bateman
On Thu, 29 Jul 2021 19:57:30 GMT, Markus KARG wrote: >> Good point. > > :-) Is this loop correct for the case that the channel gets truncated? In that case transferTo will return 0 as no bytes will be transferred and I'm concerned this code will go into an infinite loop. Also can you can

Re: RFR: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo

2021-07-30 Thread Nick Gasson
On Fri, 30 Jul 2021 10:36:01 GMT, Andrew Haley wrote: > > I was (still am) tempted to approve it, but Nick says there are still bugs in > corner cases. > I meant the earlier String.compareTo that this is partially replacing. This one might be fine but I just wanted to check it had be

Re: RFR: 8251329: (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside [v3]

2021-07-30 Thread Alan Bateman
On Fri, 30 Jul 2021 01:43:56 GMT, Jaikiran Pai wrote: >> Lance Andersen has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains six additional >>

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Fri, 30 Jul 2021 04:09:32 GMT, Kim Barrett wrote: >> src/hotspot/share/services/nmtPreInit.hpp line 166: >> >>> 164: NMTPreInitAllocation** find_entry(const void* p) const { >>> 165: const unsigned index = index_for_key(p); >>> 166: NMTPreInitAllocation** aa =

Re: RFR: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo [v4]

2021-07-30 Thread Andrew Haley
On 7/30/21 7:49 AM, Wu Yan wrote: > I aggree. This is the compromise solution that the optimization > has no effect (or even slowdown) on some platforms. > In addition, I found that in > [JDK-8202326](https://bugs.openjdk.java.net/browse/JDK-8202326), > adding prefetches is only for long strings

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Thu, 29 Jul 2021 23:03:46 GMT, Coleen Phillimore wrote: > This is an interesting and it seems a better way to solve this problem. Where > were you all those years ago?? I hope @zhengyu123 has a chance to review it. Thank you! I was here, but we were not yet doing much upstream :) To be

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Thu, 29 Jul 2021 06:37:36 GMT, David Holmes wrote: > Hi Thomas, > > I had a look through this and it seems reasonable, but I'm not familiar > enough with the details to approve at this stage. > > A few nits below. > > Thanks, > David I did not expect a quick review for this one, so

Re: RFR: JDK-8256844: Make NMT late-initializable

2021-07-30 Thread Thomas Stuefe
On Fri, 30 Jul 2021 04:03:57 GMT, Kim Barrett wrote: >> src/hotspot/share/services/nmtPreInit.hpp line 128: >> >>> 126: // Returns start of the user data area >>> 127: void* payload() { return this + 1; } >>> 128: const void* payload() const { return this + 1; } >> >> This is

RE: PhantomReferences

2021-07-30 Thread Erik Osterlund
Hi Hans, > -Original Message- > From: core-libs-dev On Behalf Of > Hans Boehm > Sent: Friday, 30 July 2021 00:07 > To: core-libs-dev > Subject: PhantomReferences > > Here's another finalization-related issue, this time hopefully appropriate for > this list. This was inspired by looking

Re: RFR: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo [v4]

2021-07-30 Thread Wu Yan
On Wed, 28 Jul 2021 09:55:18 GMT, Nick Gasson wrote: > Adding prefetches was one of the reasons to introduce the separate stub for > long strings, see the mail below: > > https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2018-April/02.html Thank you for pointing this out, we