JfrThreadSampling.cpp (353 - 360):
static void drain_enqueued_cpu_time_requests(const JfrTicks& now, JfrThreadLocal* tl, JavaThread* jt, Thread* current, bool lock) {
assert(tl != nullptr, "invariant");
assert(jt != nullptr, "invariant");
assert(current != nullptr, "invariant");
#ifdef LINUX
tl->set_do_async_processing_of_cpu_time_jfr_requests(false);
if (lock) {
tl->acquire_cpu_time_jfr_dequeue_lock(); <<---
This is your synchronization point on return from native code, which is effectively a spinlock. This can cause problems when a large number of threads are being processed by the "do_async_processing" request call.
We should fix this as a bug after integration (use a proper Monitor as a synchronization point).
static void drain_enqueued_cpu_time_requests(const JfrTicks& now, JfrThreadLocal* tl, JavaThread* jt, Thread* current, bool lock) {
assert(tl != nullptr, "invariant");
assert(jt != nullptr, "invariant");
assert(current != nullptr, "invariant");
#ifdef LINUX
tl->set_do_async_processing_of_cpu_time_jfr_requests(false);
if (lock) {
tl->acquire_cpu_time_jfr_dequeue_lock(); <<---
This is your synchronization point on return from native code, which is effectively a spinlock. This can cause problems when a large number of threads are being processed by the "do_async_processing" request call.
We should fix this as a bug after integration (use a proper Monitor as a synchronization point).