-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[core] Setup cgroup v2 in C++ #49416
Changes from 1 commit
a9e8dc6
feb0282
ce77002
995dc0f
f54f2eb
f3a4a9a
341317f
50874cd
3027ed8
12f0cfe
c5e3fd7
b679ba7
7689889
792fa54
128bfdf
d3fdd2a
2dcd1e7
56aeea9
899b27b
e15f30d
8c0af7f
2406936
30fc386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: dentiny <dentinyhao@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ namespace { | |
constexpr int kCgroupFilePerm = 0600; | ||
dentiny marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a uuid, and we should not use a name like this visible in linux. We had the idea of getting a default name from cluster ID right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not sure how cluster id is related here? |
||
// Open a cgroup path and append write [content] into the file. | ||
void OpenCgroupFileAndAppend(std::string_view path, std::string content) { | ||
void OpenCgroupFileAndAppend(std::string_view path, std::string_view content) { | ||
std::ofstream out_file{path.data(), std::ios::out | std::ios::app}; | ||
out_file << content; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: do we need this separate config class from CgroupV2Setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These data fields are necessary to construct and destruct cgroup;
As of now the struct doesn't seem that necessary since it only contains 4 fields and we could directly pass them into the factory function, but we could have much more fields (i.e. cpu-related, resource min / high), better to have a struct.