Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8358621

Reduce busy waiting in worse case at the synchronization point returning from native in CPU Time Profiler

XMLWordPrintable

    • jfr
    • b07

        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).

              jbechberger Johannes Bechberger
              mgronlun Markus Grönlund
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: