changeset 14868:31185ebcc316

8217766: Container Support doesn't work for some Join Controllers combinations Reviewed-by: rriggs, sgehwolf
author bobv
date Tue, 19 Mar 2019 12:29:40 -0400
parents ec6d52cea1e6
children b0b404c86143
files src/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java	Mon Nov 30 10:24:49 2020 +0100
+++ b/src/linux/classes/jdk/internal/platform/cgroupv1/Metrics.java	Tue Mar 19 12:29:40 2019 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -150,13 +150,13 @@
     /**
      * createSubSystem objects and initialize mount points
      */
-    private static void createSubSystem(Metrics metric, String [] mountentry) {
+    private static void createSubSystem(Metrics metric, String[] mountentry) {
         if (mountentry.length < 5) return;
 
         Path p = Paths.get(mountentry[4]);
-        String subsystemName = p.getFileName().toString();
+        String[] subsystemNames = p.getFileName().toString().split(",");
 
-        if (subsystemName != null) {
+        for (String subsystemName: subsystemNames) {
             switch (subsystemName) {
                 case "memory":
                     metric.setMemorySubSystem(new SubSystem(mountentry[3], mountentry[4]));
@@ -164,11 +164,6 @@
                 case "cpuset":
                     metric.setCpuSetSubSystem(new SubSystem(mountentry[3], mountentry[4]));
                     break;
-                case "cpu,cpuacct":
-                case "cpuacct,cpu":
-                    metric.setCpuSubSystem(new SubSystem(mountentry[3], mountentry[4]));
-                    metric.setCpuAcctSubSystem(new SubSystem(mountentry[3], mountentry[4]));
-                    break;
                 case "cpuacct":
                     metric.setCpuAcctSubSystem(new SubSystem(mountentry[3], mountentry[4]));
                     break;
@@ -188,7 +183,7 @@
     /**
      * setSubSystemPath based on the contents of /proc/self/cgroup
      */
-    private static void setSubSystemPath(Metrics metric, String [] entry) {
+    private static void setSubSystemPath(Metrics metric, String[] entry) {
         String controller;
         String base;
         SubSystem subsystem = null;