-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Linux Control Group version 2 API support cgroup v2 #1329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ChangxinDong
wants to merge
18
commits into
aws-greengrass:main
Choose a base branch
from
ChangxinDong:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
58f4ec1
feat: linux control group version 2 API support cgroup v2
ChangxinDong 52800bd
Merge branch 'aws-greengrass:main' into main
ChangxinDong 1abc7cc
feat: linux control group version 2 API support cgroup v2
yiwenTS 5832fb2
feat: linux control group version 2 API support cgroup v2
ChangxinDong 8132b86
Merge branch 'aws-greengrass:main' into main
ChangxinDong 1b95b7d
feat: linux control group version 2 API support cgroup v2
ChangxinDong b8cd781
feat: linux control group version 2 API support cgroup v2
ChangxinDong 901efe1
Merge branch 'aws-greengrass:main' into main
ChangxinDong 58441a7
feat: linux control group version 2 API support cgroup v2
ChangxinDong 8ef0143
feat: linux control group version 2 API support cgroup v2
ChangxinDong ec2348b
feat: linux control group version 2 API support cgroup v2
yiwenTS 3db48d7
feat: linux control group version 2 API support cgroup v2
ChangxinDong 996d87c
Merge branch 'aws-greengrass:main' into main
ChangxinDong c1626ce
feat: linux control group version 2 API support cgroup v2
ChangxinDong acfe1eb
Merge branch 'aws-greengrass:main' into main
ChangxinDong 6004a64
feat: linux control group version 2 API support cgroup v2
ChangxinDong 936e8eb
Merge branch 'main' of ssh://github.com/ChangxinDong/aws-greengrass-n…
ChangxinDong 1a35f5d
Merge branch 'main' into main
junfuchen99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
src/main/java/com/aws/greengrass/util/platforms/unix/linux/CGroupSubSystemPath.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.aws.greengrass.util.platforms.unix.linux; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
@SuppressFBWarnings(value = "DMI_HARDCODED_ABSOLUTE_FILENAME", | ||
justification = "CGroupSubSystemPath virtual filesystem path cannot be relative") | ||
public interface CGroupSubSystemPath { | ||
ChangxinDong marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Path CGROUP_ROOT = Paths.get("/sys/fs/cgroup"); | ||
String GG_NAMESPACE = "greengrass"; | ||
String CGROUP_MEMORY_LIMITS = "memory.limit_in_bytes"; | ||
String CPU_CFS_PERIOD_US = "cpu.cfs_period_us"; | ||
String CPU_CFS_QUOTA_US = "cpu.cfs_quota_us"; | ||
String CGROUP_PROCS = "cgroup.procs"; | ||
String FREEZER_STATE_FILE = "freezer.state"; | ||
String CPU_MAX = "cpu.max"; | ||
String MEMORY_MAX = "memory.max"; | ||
String CGROUP_SUBTREE_CONTROL = "cgroup.subtree_control"; | ||
String CGROUP_FREEZE = "cgroup.freeze"; | ||
|
||
default Path getRootPath() { | ||
return CGROUP_ROOT; | ||
} | ||
|
||
String rootMountCmd(); | ||
|
||
default String subsystemMountCmd() { | ||
return null; | ||
} | ||
|
||
Path getSubsystemRootPath(); | ||
|
||
Path getSubsystemGGPath(); | ||
|
||
Path getSubsystemComponentPath(String componentName); | ||
|
||
Path getComponentMemoryLimitPath(String componentName); | ||
|
||
default Path getComponentCpuPeriodPath(String componentName) { | ||
return null; | ||
} | ||
|
||
default Path getComponentCpuQuotaPath(String componentName) { | ||
return null; | ||
} | ||
|
||
Path getCgroupProcsPath(String componentName); | ||
|
||
Path getCgroupFreezerStateFilePath(String componentName); | ||
|
||
default Path getRootSubTreeControlPath() { | ||
return null; | ||
} | ||
|
||
default Path getGGSubTreeControlPath() { | ||
return null; | ||
} | ||
|
||
default Path getComponentCpuMaxPath(String componentName) { | ||
return null; | ||
} | ||
|
||
default Path getCgroupFreezePath(String componentName) { | ||
return null; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.