15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include <string.h>
26 #include <math.h>
27 #include <errno.h>
28 #include "utilities/globalDefinitions.hpp"
29 #include "memory/allocation.hpp"
30 #include "runtime/os.hpp"
31 #include "logging/log.hpp"
32 #include "osContainer_linux.hpp"
33
34 /*
35 * Warning: Some linux distros use 0x7FFFFFFFFFFFF000
36 * and others use 0x7FFFFFFFFFFFFFFF for unlimited.
37 */
38 #define UNLIMITED_MEM CONST64(0x7FFFFFFFFFFFF000)
39
40 #define PER_CPU_SHARES 1024
41
42 bool OSContainer::_is_initialized = false;
43 bool OSContainer::_is_containerized = false;
44
45 class CgroupSubsystem: CHeapObj<mtInternal> {
46 friend class OSContainer;
47
48 private:
49 /* mountinfo contents */
50 char *_root;
51 char *_mount_point;
52
53 /* Constructed subsystem directory */
54 char *_path;
55
56 public:
57 CgroupSubsystem(char *root, char *mountpoint) {
58 _root = os::strdup(root);
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include <string.h>
26 #include <math.h>
27 #include <errno.h>
28 #include "utilities/globalDefinitions.hpp"
29 #include "memory/allocation.hpp"
30 #include "runtime/os.hpp"
31 #include "logging/log.hpp"
32 #include "osContainer_linux.hpp"
33
34 /*
35 * Warning: Some linux distros use 0x7FFFFFFFFFFFF000,
36 * some (SLES 12.1 ppc64le) 0x7FFFFFFFFFFF0000,
37 * and others use 0x7FFFFFFFFFFFFFFF for unlimited.
38 */
39 #define UNLIMITED_MEM CONST64(0x7FFFFFFFFFFF0000)
40
41 #define PER_CPU_SHARES 1024
42
43 bool OSContainer::_is_initialized = false;
44 bool OSContainer::_is_containerized = false;
45
46 class CgroupSubsystem: CHeapObj<mtInternal> {
47 friend class OSContainer;
48
49 private:
50 /* mountinfo contents */
51 char *_root;
52 char *_mount_point;
53
54 /* Constructed subsystem directory */
55 char *_path;
56
57 public:
58 CgroupSubsystem(char *root, char *mountpoint) {
59 _root = os::strdup(root);
|