Re: RFR: 8307153: JVMTI GetThreadState on carrier should return STATE_WAITING [v5]

2023-06-07 Thread Serguei Spitsyn
On Wed, 7 Jun 2023 05:50:46 GMT, Alan Bateman  wrote:

>>> > is_carrying_carrier_thread? a bit artificial, but it's a carrier thread 
>>> > and it's carrying a virtual thread
>>> 
>>> I guess, your suggestion is `is_carrying_virtual_thread`. Is it right? If 
>>> so, I like this suggestion.
>> 
>> Up to you. I think any of this names is better than 
>> is_passive_carrier_thread.
>
>> I guess, your suggestion is `is_carrying_virtual_thread`. Is it right? If 
>> so, I like this suggestion.
> 
> Good, I think will be easy to understand at the use sites.

Thank you, Alan and Alex.

-

PR Review Comment: https://git.openjdk.org/jdk/pull/14298#discussion_r1221417248


Re: RFR: 8307153: JVMTI GetThreadState on carrier should return STATE_WAITING [v5]

2023-06-07 Thread Serguei Spitsyn
> When a virtual thread is mounted, the carrier thread should be reported as 
> "waiting" until the virtual thread unmounts. Right now, GetThreadState 
> reports a state based the JavaThread status when it should return 
> JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY.
> The fix adds:
>  - a special case for passive carrier threads
>  - necessary test coverage to the existing JVMTI test: 
> `serviceability/jvmti/vthread/ThreadStateTest`.
> 
> Testing:
>- tested with the updated test: 
> `serviceability/jvmti/vthread/ThreadStateTest`
>- submitted mach5 tiers 1-5
>- TBD: to submit mach5 tier 6

Serguei Spitsyn 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 
commits since the last revision:

 - Merge
 - review: call get_thread_state_base only when needed
 - review: removed JVMTI_THREAD_STATE_RUNNABLE from a carrier thread state
 - Merge
 - minor tweaks in libThreadStateTest.cpp
 - 8307153: JVMTI GetThreadState on carrier should return STATE_WAITING

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/14298/files
  - new: https://git.openjdk.org/jdk/pull/14298/files/1816..3e7618c4

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=14298=04
 - incr: https://webrevs.openjdk.org/?repo=jdk=14298=03-04

  Stats: 14603 lines in 141 files changed: 9240 ins; 4758 del; 605 mod
  Patch: https://git.openjdk.org/jdk/pull/14298.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14298/head:pull/14298

PR: https://git.openjdk.org/jdk/pull/14298