Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b9babc

Browse files
antonvozniaPaul Hohensee
authored and
Paul Hohensee
committed
8347129: cpuset cgroups controller is required for no good reason
Backport-of: 2de71d04454b04ee887f7bd3e5decbfaa9ab8460
1 parent912a12b commit9b9babc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/hotspot/os/linux/cgroupSubsystem_linux.cpp‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include"utilities/globalDefinitions.hpp"
3636

3737
// controller names have to match the *_IDX indices
38-
staticconstchar* cg_controller_name[] = {"cpu","cpuset","cpuacct","memory","pids" };
38+
staticconstchar* cg_controller_name[] = {"cpuset","cpu","cpuacct","memory","pids" };
3939

4040
CgroupSubsystem*CgroupSubsystemFactory::create() {
4141
CgroupV1MemoryController* memory =NULL;
@@ -159,9 +159,10 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
159159
char buf[MAXPATHLEN+1];
160160
char *p;
161161
bool is_cgroupsV2;
162-
// true iff all required controllers, memory, cpu,cpuset,cpuacct are enabled
162+
// true iff all required controllers, memory, cpu, cpuacct are enabled
163163
// at the kernel level.
164164
// pids might not be enabled on older Linux distros (SLES 12.1, RHEL 7.1)
165+
// cpuset might not be enabled on newer Linux distros (Fedora 41)
165166
bool all_required_controllers_enabled;
166167

167168
/*
@@ -193,6 +194,7 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
193194
cg_infos[MEMORY_IDX]._hierarchy_id = hierarchy_id;
194195
cg_infos[MEMORY_IDX]._enabled = (enabled ==1);
195196
}elseif (strcmp(name,"cpuset") ==0) {
197+
log_debug(os, container)("Detected optional cpuset controller entry in %s", proc_cgroups);
196198
cg_infos[CPUSET_IDX]._name =os::strdup(name);
197199
cg_infos[CPUSET_IDX]._hierarchy_id = hierarchy_id;
198200
cg_infos[CPUSET_IDX]._enabled = (enabled ==1);
@@ -216,8 +218,8 @@ bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
216218
is_cgroupsV2 =true;
217219
all_required_controllers_enabled =true;
218220
for (int i =0; i < CG_INFO_LENGTH; i++) {
219-
// pidscontroller is optional. All other controllers are required
220-
if (i != PIDS_IDX) {
221+
// pidsand cpuset controllers are optional. All other controllers are required
222+
if (i != PIDS_IDX && i != CPUSET_IDX) {
221223
is_cgroupsV2 = is_cgroupsV2 && cg_infos[i]._hierarchy_id ==0;
222224
all_required_controllers_enabled = all_required_controllers_enabled && cg_infos[i]._enabled;
223225
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp