-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Various accountings are not implied by their controllers #9669
Conversation
The original manpage says "Implies BBBAccounting" many times but actually that accounting is not implied by the respective resource control in v239 with the unified cgroup hierarchy. This commit removes those false explanations.
Hold on. @poettering I think we should revert this patch. For example, CPUQuota does imply CPUAccounting in the source code of Here's the first place the statement comes from: It changed a bit three months later. They are still there now: Lines 1063 to 1091 in 4d7293f
The issue #9647 does exist but only for using user instance. |
@ryutaroh-matsumoto can you revert the change and instead add "for the systemd instance" where necessary? |
@keszybz Yes, I can. But please wait. What I wrote at 9647 was that On the other hand, we probably agree that
So just updating the documentation as requested seems to make situation worse, that is, the difference between the documentation and the actual behavior becomes larger than now. |
Yes, that's true, but it may be not worse, it "exposed" the bugs that systemd has. The documentation and the specifications of design are what a project based on. If we remove it, other people may think we are planning to deprecate the feature, so users may think "they have to add "CPUAccounting=true" ASAP otherwise their program is going to break." and developers could go ahead to remove the feature entirely. However, we are going to fix it, I think it's not a #wontfix issue. The documentation described how we want systemd to work. On the other side, regarding your research on cgroups components, the difference between the program logic in accounting resources and documentation is large. Let's think about "which side is the 'good' one". Considering those differences "bugs in the implementation of systemd" and fixing it are exactly the things we should do now in my opinion. :-) |
I assume the unified cgroup controller. I think we should make clear distinction among the following three concepts in our discussion.
I have always meant 3 by "CPUAccounting" in this thread. On the other hand, @LionNatsu seems to have meant 1 in his/her first post at #9669 (comment) (sorry I cannot identify your gender). We should first agree on the meanings of words, otherwise our precious time will be wasted by a confused conversation. |
As a side note, in PR 9665 it is planned that
This change obscures the operational meaning of |
So in this PR 9669, I just proposed to update the documentation to correctly reflect what are done by systemd, without discussing what is a correct design. I am not a core developer and I do not intend to propose a design which I think right/correct. |
Thank you for the quick reply.
To be honest, I mean 1 and 3. What happened to me is that I was trying to use CPUQuota (kernel 4.17, systemd 139, unified hierarchy) few days ago and it ran into all the same problems you mentioned (so I am here to figure out what is going on). CPUQuota in --user is now buggy. There are also issues on showing the CPUAccounting value too. (Btw, sorry for this confusing nickname, I am male.)
So setting CPUAccounting cannot always work properly, getting CPUAccounting is also problematic. This is problem confusing me as a user.
I understand (I am not a core developer too). But just in my opinion, specifying a CPUQuota without explicitly specifying CPUAccounting is convenient. Let's see what we can do about it? |
Checking #9665, I agree with you to separate "CPUAccounting" from other controller options. IMO, two PRs seems should be one. I'm not sure if here is the right place to ask this question: can systemd add CPUController, MemoryController… to reflect the underlying mask status ? |
I am willing to do that. But in order to consider/find a right/correct design, one needs to understand how all of legacy, hybrid and unified cgroup hierarchies are handled by systemd and related programs. Support for those three hierarchies simultaneously turns the programming logic of systemd into a chaos (I should use a more polite word). I knows only the unified cgroup hierarchy and related programming logic in systemd, and not motivated to dig into the legacy or the hybrid hierarchy, as they will fade out. Because I am reluctant to learn the legacy and the hybrid hierarchy, I will wait a responses from a core member. But you are welcome to express your own opinions. I will just wait a core member's response (unless I am asked to answer). |
@LionNatsu you said that
@keszybz After @LionNatsu and I reached to a same recognition, I would like to ask if you still request 'revert the change and instead add "for the systemd instance" where necessary'. |
@ryutaroh-matsumoto I think that's because I misunderstood what "implies CPUAccounting" means. I only found the CPU accounting features "also" works when I turned on the CPUQuota. It seems the switch (CPUAccounting) was turn on simultaneously, but the fact is cpu.stat features works regardless of the CPUAcounting is on or off, and CPUAccounting doesn't reflect the features (cpu.stat) can or cannot work, which has a enhancement PR has been filed at #9665. In some ways, the PR stepped out the significant step to make the CPUAccounting more semantically distinguishing. I remember that it's also the initial thoughts of the cgroup v2 design (according to documentation of itself) so we can let one daemon (systemd) to manage controllers, provide resource control features on demand and get rid of complicated dependencies between controllers. Please correct me if I am wrong. Hence I am closing the revert request. Would you @keszybz kindly remove the #merged-but-needs-fixing tag for the PR if there is no other problems? Thanks again. |
The original manpage says
Implies BBBAccounting=true
many times but actually that accounting is not implied by the respective resource control in v239 with the unified cgroup hierarchy. This commit removes those false explanations and fixes #9647