RFR: 8146115 - Improve docker container detection and resource configuration usage

Robbin Ehn robbin.ehn at oracle.com
Mon Oct 2 20:20:58 UTC 2017


Hi Bob,

As I said in your presentation for RT.
If kernel if configured with cgroup this should always be read (otherwise we get wrong values).
E.g. fedora have had cgroups default on several years (I believe most distros have it on).

- No option is needed at all: right now we have wrong values your fix will provide right ones, why would you ever what to turn that off?
- log target container would make little sense since almost all linuxes run with croups on.
- For cpuset, the processes affinity mask already reflect cgroup setting so you don't need to look into cgroup for that
   If you do, you would miss any processes specific affinity mask. So _cpu_count() should already be returning the right number of CPU's.

Thanks for trying to fixing this!

/Robbin

On 09/22/2017 04:27 PM, Bob Vandette wrote:
> Please review these changes that improve on docker container detection and the
> automatic configuration of the number of active CPUs and total and free memory
> based on the containers resource limitation settings and metric data files.
> 
> http://cr.openjdk.java.net/~bobv/8146115/webrev.00/ <http://cr.openjdk.java.net/~bobv/8146115/webrev.00/>
> 
> These changes are enabled with -XX:+UseContainerSupport.
> 
> You can enable logging for this support via -Xlog:os+container=trace.
> 
> Since the dynamic selection of CPUs based on cpusets, quotas and shares
> may not satisfy every users needs, I’ve added an additional flag to allow the
> number of CPUs to be overridden.  This flag is named -XX:ActiveProcessorCount=xx.
> 
> 
> Bob.
> 
> 
> 


More information about the hotspot-dev mailing list