RFR: 8253694: Remove Thread::muxAcquire() from ThreadCrashProtection()

Robbin Ehn rehn at openjdk.java.net
Wed Sep 30 06:55:58 UTC 2020


On Wed, 30 Sep 2020 06:43:12 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Hi all,
>> 
>> Please review the following patch. Current ThreadCrashProtection() implementation uses static members which requires
>> the use of Thread::muxAcquire() to allow only one user at a time. We can avoid this synchronization requirement if each
>> thread has its own ThreadCrashProtection *data. I tested it builds on Linux, macOS and Windows. Since the
>> JfrThreadSampler is the only one using this I run all the tests from test/jdk/jdk/jfr/. I also run some tests with JFR
>> enabled while forcing a crash in OSThreadSampler::protected_task() and tests passed with several "Thread method sampler
>> crashed" UL output. Also run tiers1-3.  Thanks, Patricio
>
> Hi Patricio,
> 
> This seems fine, but I'm wondering what the motivation for this change was? Adding more per-thread state is arguably
> just adding to the clutter of per-thread state. I don't know if this approach was considered when @robehn fixed
> JDK-8183925.  Thanks,
> David

I don't think so.

I have not seen crash protection catching anything since pre-JDK 9. (we did a lot of fixes to the stack-walking code)
I would remove it completely instead :) Not sure what JFR team says...

-------------

PR: https://git.openjdk.java.net/jdk/pull/376


More information about the hotspot-jfr-dev mailing list