Skip to content

Conversation

@pchilano
Copy link
Contributor

@pchilano pchilano commented Dec 3, 2024

Please review this small renaming patch. During the review of JDK-8338383 there were some comments about improving the naming for ObjectMonitor::owner_from() and JavaThread::_lock_id. These originate from the changes introduced to inflated monitors, where we now record the java.lang.Thread.tid of the owner in the ObjectMonitor's _owner field instead of a JavaThread*. I renamed _lock_id as _monitor_owner_id and owner_from() as owner_id_from().

Thanks,
Patricio


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22524/head:pull/22524
$ git checkout pull/22524

Update a local copy of the PR:
$ git checkout pull/22524
$ git pull https://git.openjdk.org/jdk.git pull/22524/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22524

View PR using the GUI difftool:
$ git pr show -t 22524

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22524.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 3, 2024

👋 Welcome back pchilanomate! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 3, 2024

@pchilano This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id

Reviewed-by: coleenp, dholmes

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 74 new commits pushed to the master branch:

  • faa109e: 8340580: Characters in Document diagrams not in the middle
  • 6aa7667: 8339535: JVM crashes with -Xshare:dump -XX:+SegmentedCodeCache
  • e1695f6: 8345472: Fix incorrect format instruction for floating point max/min patterns
  • baa6957: 8345507: Fix build of static launcher
  • 79eb77b: 8345486: Reevaluate the classes in java.lang.classfile.components package
  • f3b4350: 8345219: C2: x86_64 should not go to interpreter stubs for NaNs handling
  • 16ef6e2: 8344229: Revisit SecurityManager usage in jdk.httpserver after JEP 486 integration
  • 923321c: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04
  • 6f30762: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04
  • 6c1ed0b: 8345474: Translation for instanceof is not triggered when patterns are not used in the compilation unit
  • ... and 64 more: https://git.openjdk.org/jdk/compare/68b1b94d1be686037e2aaef57c0d9adc594fac7a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Dec 3, 2024

@pchilano The following labels will be automatically applied to this pull request:

  • graal
  • hotspot
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@pchilano pchilano marked this pull request as ready for review December 3, 2024 20:07
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 3, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 3, 2024

Webrevs

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming looks good and makes it clearer what the id is.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 3, 2024
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes.

One minor nit, but looks good.

Comment on lines 172 to 174
void set_monitor_owner_id(int64_t val) {
assert(val >= ThreadIdentifier::initial() && val < ThreadIdentifier::current(), "");
_monitor_owner_id = val;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Using id rather than val would be more consistent with other changes (ObjectMonitor::owner_id_from)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

if (p->is_vthread_mounted()) {
// _lock_id is the thread ID of the mounted virtual thread
st->print_cr(" Mounted virtual thread #" INT64_FORMAT, p->lock_id());
st->print_cr(" Mounted virtual thread #" INT64_FORMAT, java_lang_Thread::thread_id(p->vthread()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was initially unsure why p->lock_id() didn't change to p->monitor_owner_id(), but here you want the thread-id not something that happens to match the thread-id.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 4, 2024
Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update looks good!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 4, 2024
@pchilano
Copy link
Contributor Author

pchilano commented Dec 4, 2024

Thanks for the reviews Coleen and David!

@pchilano
Copy link
Contributor Author

pchilano commented Dec 4, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 4, 2024

Going to push as commit c113f82.
Since your change was applied there have been 81 commits pushed to the master branch:

  • ea73e05: 8345181: (ch) Windows asynchronous channels may return temporary direct buffers to the buffer cache twice (win)
  • ee0f88c: 8341923: java.util.Locale class specification improvements
  • a72cab8: 8345148: Fix for JDK-8337317 is incomplete
  • 1a73c76: 8345524: CHECK_FOR_FILES should properly handle directories
  • 1d3dcdf: 8345433: (fs) Use stream to load FileTypeDetectors in Files.probeContentType
  • 9740c1d: 8333572: Update jpackage.md with info related to WiX v4 and v5 support
  • de3a218: 8345502: Remove doIntersectionPrivilege methods
  • faa109e: 8340580: Characters in Document diagrams not in the middle
  • 6aa7667: 8339535: JVM crashes with -Xshare:dump -XX:+SegmentedCodeCache
  • e1695f6: 8345472: Fix incorrect format instruction for floating point max/min patterns
  • ... and 71 more: https://git.openjdk.org/jdk/compare/68b1b94d1be686037e2aaef57c0d9adc594fac7a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 4, 2024
@openjdk openjdk bot closed this Dec 4, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 4, 2024
@openjdk
Copy link

openjdk bot commented Dec 4, 2024

@pchilano Pushed as commit c113f82.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…ds without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…ds without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…ds without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 21, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 23, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to AOSC-Tracking/jdk that referenced this pull request Jan 23, 2025
…without Pinning

Fixes: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Fixes: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Follow-up: 78b8015 ("8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning")
Follow-up: c113f82 ("8343957: Rename ObjectMonitor::owner_from() and JavaThread::_lock_id")
Link: openjdk#21565
Link: openjdk#22524
Signed-off-by: Bingwu Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants