<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 2015-04-23 19:52, Derek White wrote:<br>
    </div>
    <blockquote cite="mid:55393143.1060502@oracle.com" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      <div class="moz-cite-prefix">I'll spin this part
        (active_processor_count() vs processor_count()) as a separate
        RFE. Earlier web searches turned up similar discussions on the
        linux kernel mailing lists on what really should be counted.<br>
      </div>
    </blockquote>
    <br>
    Good idea. :)<br>
    <br>
    Bengt<br>
    <br>
    <blockquote cite="mid:55393143.1060502@oracle.com" type="cite">
      <div class="moz-cite-prefix"> <br>
        - Derek<br>
        <br>
        On 4/23/15 1:13 PM, Jon Masamitsu wrote:<br>
      </div>
      <blockquote cite="mid:55392838.5090900@oracle.com" type="cite">
        <meta content="text/html; charset=utf-8"
          http-equiv="Content-Type">
        On 04/23/2015 12:46 AM, Bengt Rutisson wrote:<br>
        <blockquote cite="mid:5538A341.6020302@oracle.com" type="cite">
          <meta content="text/html; charset=utf-8"
            http-equiv="Content-Type">
          <div class="moz-cite-prefix">On 22/04/15 17:45, Jon Masamitsu
            wrote:<br>
          </div>
          <blockquote cite="mid:5537C215.4060806@oracle.com" type="cite">
            <meta content="text/html; charset=utf-8"
              http-equiv="Content-Type">
            On 4/21/2015 2:57 PM, bill pittore wrote:<br>
            <blockquote cite="mid:5536C7BE.4000405@oracle.com"
              type="cite">
              <meta content="text/html; charset=utf-8"
                http-equiv="Content-Type">
              ...</blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
      <blockquote cite="mid:55392838.5090900@oracle.com" type="cite">
        <blockquote cite="mid:5538A341.6020302@oracle.com" type="cite">
          <blockquote cite="mid:5537C215.4060806@oracle.com" type="cite">
            <blockquote cite="mid:5536C7BE.4000405@oracle.com"
              type="cite">There is definitely a difference between the
              processor count and the online processor count.  It seems
              that the calculation of ParallelGCThreads uses the online
              count which could easily be 1 on some embedded platform
              since the kernel does do active power management by
              shutting off cores.  The comment in os.hpp for
              active_processor_count() says "Returns the number of CPUs
              this process is currently allowed to run on".  On linux at
              least I don't think that's correct. Cores could be powered
              down just because the kernel is in some low power state
              and not because of some affinity property for this
              particular Java process. I'd change the calculation to
              call processor_count() instead of
              active_processor_count().<br>
            </blockquote>
            <br>
            An early implementation used processor_count() and there was
            some issue with virtualization.<br>
            I forget what the virtualization was but it was something
            like Solaris containers or zones.  Let me<br>
            call them containers.  A container on an 8 processor machine
            might only get 1 processor but<br>
            processor_count() would return 8.   It may also have been on
            a system where there were 8<br>
            processors but 7 were disabled.  Only 1 processor was
            available to execute the JVM but<br>
            processor_count() returned 8.  Anyway, if anyone thinks it
            should be processor_count()<br>
            instead of active_processor_count(), check those types of
            situations.<br>
          </blockquote>
          <br>
          Jon,<br>
          <br>
          In the hg repo it has always been active_processor_count(). I
          was not able to figure out exactly when it was changed from
          processor_count(), but back in 2003 when JDK-4804915 was
          pushed it was already active_processor_count(). So, maybe it
          is worth re-evaluating processor_count() again. I don't
          pretend that I know what the correct answer here is, it just
          feels like a lot has happened in the virtualization area over
          the past 10+ years so maybe we should reconsider how we
          calculate the number of worker threads. Especially if it
          causes problems on embedded.<br>
        </blockquote>
        <br>
        No argument there.  I just wanted to point out situations where
        it<br>
        might matter.<br>
        <br>
        <blockquote cite="mid:5538A341.6020302@oracle.com" type="cite">
          <br>
          Also, I find the comment for active_processor_count() a bit
          worrying.<br>
          <br>
            // Returns the number of CPUs this process is currently
          allowed to run on.<br>
            // Note that on some OSes this can change dynamically.<br>
            static int active_processor_count();<br>
          <br>
          We read it only once and set the static value for
          ParallelGCThreads based on this. But apparently it can change
          over time so why do we think that we get a good value to start
          with?<br>
        </blockquote>
        <br>
        At the time the number of parallel GC threads could not change
        so<br>
        we were stuck with the value at the start.  Even today
        increasing<br>
        beyond the original maximum GC threads would take some work<br>
        (arrays sized for the maximum number of GC threads, for
        example).<br>
        There's plenty of ergonomics work like that to do.<br>
        <br>
        Jon<br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>