Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Patricio Chilano Mateo
On Thu, 7 Nov 2024 18:32:14 GMT, Serguei Spitsyn wrote: >> Patricio Chilano Mateo has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use JvmtiVTMSTransitionDisabler::VTMS_vthread_mount/unmount > > src/hotspot/share/prims/jvmtiThreadState.cp

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Serguei Spitsyn
On Thu, 7 Nov 2024 00:38:18 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without >> Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for >> further details. >> >> In order to make the code review easier the changes

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Serguei Spitsyn
On Thu, 7 Nov 2024 00:38:57 GMT, Patricio Chilano Mateo wrote: >>> the call to java_lang_Thread::set_is_in_VTMS_transition()is not needed in >>> JvmtiUnmountBeginMark >>> >> Why is not needed? I guess you meant to say we should use >> `JvmtiVTMSTransitionDisabler::set_is_in_VTMS_transition()`

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Serguei Spitsyn
On Thu, 7 Nov 2024 00:40:26 GMT, Patricio Chilano Mateo wrote: >>> So at some point I think we need to figure out how to make them go away ... >> >> Yes, the 2 extension events (`VirtualThreadMount` and >> `VirtualThreadUnmount`) were added for testing purposes. We wanted to get >> rid of th

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Serguei Spitsyn
On Thu, 7 Nov 2024 00:38:18 GMT, Patricio Chilano Mateo wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without >> Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for >> further details. >> >> In order to make the code review easier the changes

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Amit Kumar
On Thu, 7 Nov 2024 09:40:19 GMT, Alan Bateman wrote: >I think we can add @requires vm.continuations to this test. It's not useful to >run with the alternative virtual thread implementation. Sure, that sounds ok. Thanks. - PR Comment: https://git.openjdk.org/jdk/pull/21565#issuecom

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Alan Bateman
On Wed, 6 Nov 2024 17:38:59 GMT, Patricio Chilano Mateo wrote: >> Good work! I'll approve the GC related changes. >> >> There are some simplifications I think can be done in the ObjectMonitor >> layer, but nothing that should go into this PR. >> >> Similarly, (even if some of this is preexist

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-07 Thread Amit Kumar
On Wed, 6 Nov 2024 17:38:59 GMT, Patricio Chilano Mateo wrote: >> Good work! I'll approve the GC related changes. >> >> There are some simplifications I think can be done in the ObjectMonitor >> layer, but nothing that should go into this PR. >> >> Similarly, (even if some of this is preexist

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-06 Thread Patricio Chilano Mateo
On Wed, 6 Nov 2024 15:57:55 GMT, Serguei Spitsyn wrote: > The two extension events were designed to be posted when the current thread > identity is virtual, so this behavior > needs to be considered as a bug. My > understanding is that it is not easy to fix. > If we want to post the mount/unmou

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-06 Thread Patricio Chilano Mateo
On Thu, 7 Nov 2024 00:38:40 GMT, Patricio Chilano Mateo wrote: >>> So, it feels like it should not be a problem. I'm thinking if adding an >>> assert at the VTMS transition end would help. >>> >> The problem here is that for monitorenter the top frame will not be a native >> method, so the bai

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-06 Thread Patricio Chilano Mateo
On Thu, 7 Nov 2024 00:37:17 GMT, Patricio Chilano Mateo wrote: >> Thank you for the comment! I'm okay with your modified suggestion in general >> if there are no road blocks. >> >>> but does the specs say the event has to be posted in the context of the >>> vthread? >> >> As Alan said below

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-06 Thread Patricio Chilano Mateo
On Thu, 7 Nov 2024 00:37:53 GMT, Patricio Chilano Mateo wrote: >> Great, I applied the suggested simplification. I had to update test >> `VThreadEventTest.java` to check the stack during the mount/unmount events >> to only count the real cases. This is because now we are getting a variable >>

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-06 Thread Patricio Chilano Mateo
On Wed, 6 Nov 2024 16:31:24 GMT, Serguei Spitsyn wrote: >> Regarding the pop_frame/early_ret/async_exception conditions, not checking >> for them after we started the transition would be an issue. >> For pop_frame/early_ret checks, the problem is that if any of them are >> installed in `JvmtiUn

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

2024-11-06 Thread Patricio Chilano Mateo
> This is the implementation of JEP 491: Synchronize Virtual Threads without > Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for > further details. > > In order to make the code review easier the changes have been split into the > following initial 4 commits: > > - Change