-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for rdma cgroup introduced in Linux Kernel 4.11 #2883
Conversation
2f865ee
to
c357a29
Compare
libcontainer/cgroups/fs/rdma.go
Outdated
} | ||
|
||
// Parse raw string to RdmaEntry | ||
func ParseRdmaKV(raw string, entry *cgroups.RdmaEntry) { |
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.
Why this function is public?
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.
@kolyshkin Following function is intentionally public as being used by rdma controller in fs2
. I didnt wanted to have redundant code in both implementations of fs
and fs2
and these functions are exclusive to Rdma so i thought i'd rather keep them with rdma and not move to fscommon
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.
fscommon can hold the helper for RDMA. fs2 imports fscommon better than fs package. just my two cents.
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.
@fuweid Oh so idea was since ParseRdmaKV
and ConvertRdmaEntry
uses types from package cgroups
having them in fscommon
will introduce import cycles
. Since both of these functions are only going to be used only by rdma
therefore i thought its better to keep them with rdma
implementation only. But let me know if you guys think otherwise we can figure out a way. 😄
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.
I prefer to keep the duplicate code in separate packages (non-binding). :)
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.
I think this should go to fscommon
, which naturally contains the stuff that's common between fs and fs2.
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.
Which is a problem, as described above (02eb723#r610598989).
To solve it, I think we should move OpenFile/ReadFile etc from fscommon to cgroups/utils
.
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.
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.
Resolved in latest commit.
Looks good in general, left some comments. We also need some integration tests for that. |
eaa7eee
to
09a39b6
Compare
@kolyshkin Thanks for the quick review, i have fixed almost everything. 3 comments are still unresolved but i have commented the reason on the review itself. Could you please take a look. |
I see there's a typo in the commit message ("kernal" instead of "kernel"); perhaps good to fix that in case we want to find it back later if someone searches for |
@kolyshkin Resolved all of them just a small doubt in first one i have tried clarifying in review itself. |
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.
One fix (to the code that I suggested), one nit, and a note about documentation about functions.
You write it as
// FuncName: does this and that.
It should be
// FuncName does this and that.
@kolyshkin I have made requested changes could you PTAL. |
@kolyshkin Could you please let me know if anything is pending here from my side. |
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.
LGTM
@thaJeztah @AkihiroSuda PTAL
1480de6
to
3af910d
Compare
Signed-off-by: Aditya Rajan <[email protected]>
@AkihiroSuda thanks :) resolved in latest commit. |
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.
LGTM
RDMA controller/cgroup support is added with Linux kernel 4.11.
Similar format is used by cgroup-v2
Reference
https://www.kernel.org/doc/Documentation/cgroup-v1/rdma.txt