Skip to content

Commit 293b184

Browse files
committed
svm: readd libcontainer namespace
1 parent b3bebe4 commit 293b184

37 files changed

+374
-2
lines changed

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupSubsystem_linux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
#endif
4545

4646
// controller names have to match the *_IDX indices
47+
48+
namespace svm_container {
49+
4750
static const char* cg_controller_name[] = { "cpuset", "cpu", "cpuacct", "memory", "pids" };
4851
static inline int cg_v2_controller_index(const char* name) {
4952
if (strcmp(name, "cpuset") == 0) {
@@ -900,3 +903,6 @@ void CgroupSubsystem::print_version_specific_info(outputStream* st) {
900903
memory_controller()->controller()->print_version_specific_info(st, phys_mem);
901904
}
902905
#endif // !NATIVE_IMAGE
906+
907+
} // namespace svm_container
908+

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupSubsystem_linux.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@
103103
log_trace(os, container)(log_string " is: %s", retval); \
104104
}
105105

106+
107+
namespace svm_container {
108+
106109
class CgroupController: public CHeapObj<mtInternal> {
107110
protected:
108111
char* _cgroup_path;
@@ -361,4 +364,7 @@ class CgroupSubsystemFactory: AllStatic {
361364
static void cleanup(CgroupInfo* cg_infos);
362365
};
363366

367+
368+
} // namespace svm_container
369+
364370
#endif // CGROUP_SUBSYSTEM_LINUX_HPP

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupUtil_linux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#include "os_linux.hpp"
2828
#include "cgroupUtil_linux.hpp"
2929

30+
31+
namespace svm_container {
32+
3033
int CgroupUtil::processor_count(CgroupCpuController* cpu_ctrl, int host_cpus) {
3134
assert(host_cpus > 0, "physical host cpus must be positive");
3235
int limit_count = host_cpus;
@@ -175,3 +178,6 @@ void CgroupUtil::adjust_controller(CgroupCpuController* cpu) {
175178
os::free(orig);
176179
os::free(limit_cg_path);
177180
}
181+
182+
} // namespace svm_container
183+

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupUtil_linux.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include "utilities/globalDefinitions.hpp"
3131
#include "cgroupSubsystem_linux.hpp"
3232

33+
34+
namespace svm_container {
35+
3336
class CgroupUtil: AllStatic {
3437

3538
public:
@@ -42,4 +45,7 @@ class CgroupUtil: AllStatic {
4245
static void adjust_controller(CgroupCpuController* c);
4346
};
4447

48+
49+
} // namespace svm_container
50+
4551
#endif // CGROUP_UTIL_LINUX_HPP

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
* component is found. The subsystem path will be set to
8181
* the _mount_point joined with the subgroup path.
8282
*/
83+
84+
namespace svm_container {
85+
8386
void CgroupV1Controller::set_subsystem_path(const char* cgroup_path) {
8487
if (_cgroup_path != nullptr) {
8588
os::free(_cgroup_path);
@@ -462,3 +465,6 @@ jlong CgroupV1Subsystem::pids_current() {
462465
CONTAINER_READ_NUMBER_CHECKED(_pids, "/pids.current", "Current number of tasks", pids_current);
463466
return (jlong)pids_current;
464467
}
468+
469+
} // namespace svm_container
470+

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupV1Subsystem_linux.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
// Cgroups version 1 specific implementation
3535

36+
37+
namespace svm_container {
38+
3639
class CgroupV1Controller: public CgroupController {
3740
private:
3841
/* mountinfo contents */
@@ -210,4 +213,7 @@ class CgroupV1Subsystem: public CgroupSubsystem {
210213

211214
};
212215

216+
217+
} // namespace svm_container
218+
213219
#endif // CGROUP_V1_SUBSYSTEM_LINUX_HPP

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#include "cgroupUtil_linux.hpp"
2929

3030
// Constructor
31+
32+
namespace svm_container {
33+
3134
CgroupV2Controller::CgroupV2Controller(char* mount_path,
3235
char *cgroup_path,
3336
bool ro) : _read_only(ro),
@@ -375,3 +378,6 @@ jlong CgroupV2Subsystem::pids_current() {
375378
CONTAINER_READ_NUMBER_CHECKED(unified(), "/pids.current", "Current number of tasks", pids_current);
376379
return pids_current;
377380
}
381+
382+
} // namespace svm_container
383+

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#include "cgroupSubsystem_linux.hpp"
3131
#include "cgroupUtil_linux.hpp"
3232

33+
34+
namespace svm_container {
35+
3336
class CgroupV2Controller: public CgroupController {
3437
private:
3538
bool _read_only;
@@ -176,4 +179,7 @@ class CgroupV2Subsystem: public CgroupSubsystem {
176179
CgroupCpuacctController* cpuacct_controller() override { return _cpuacct; };
177180
};
178181

182+
183+
} // namespace svm_container
184+
179185
#endif // CGROUP_V2_SUBSYSTEM_LINUX_HPP

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/osContainer_linux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
#include "cgroupSubsystem_linux.hpp"
3535

3636

37+
38+
namespace svm_container {
39+
3740
bool OSContainer::_is_initialized = false;
3841
bool OSContainer::_is_containerized = false;
3942
CgroupSubsystem* cgroup_subsystem;
@@ -214,3 +217,6 @@ void OSContainer::print_container_helper(outputStream* st, jlong j, const char*
214217
}
215218
}
216219
#endif // !NATIVE_IMAGE
220+
221+
} // namespace svm_container
222+

substratevm/src/com.oracle.svm.native.libcontainer/src/hotspot/os/linux/osContainer_linux.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
// 20ms timeout between re-reads of memory limit and _active_processor_count.
3737
#define OSCONTAINER_CACHE_TIMEOUT (NANOSECS_PER_SEC/50)
3838

39+
40+
namespace svm_container {
41+
3942
class OSContainer: AllStatic {
4043

4144
private:
@@ -83,4 +86,7 @@ inline bool OSContainer::is_containerized() {
8386
return _is_containerized;
8487
}
8588

89+
90+
} // namespace svm_container
91+
8692
#endif // OS_LINUX_OSCONTAINER_LINUX_HPP

0 commit comments

Comments
 (0)