OpenEneaLinux / rt-tools

Collection of Linux tools for achieving real-time performance
BSD 3-Clause "New" or "Revised" License
32 stars 17 forks source link

Will partrt function with cgroup v2 ? #9

Open chmike opened 2 years ago

chmike commented 2 years ago

The latest version of the 64bit rasberry PI OS (raspbian OS) based on Debian bullseye doesn’t seam to support isolcpus anymore. I thus consider using your tool to isolate a core. The command mount | grep cgroup tells me that raspbian OS uses cgroup v2.

Is your rt-tools compatible with cgroup v2 ?

matslil commented 2 years ago

I would say no simply because I haven't tested that yet. I haven't looked at the specification for V2 either so I don't know the differences, but it might be worth doing in case it solves some of the problems I've had with coexisting with systemd.

chmike commented 2 years ago

Hello, thank you for answering. I tested partrt with cgroup v2 and it didn't work.

I tried to create cpusets with cgroup v2 manually, inspired by your code, and I met the problem that most process (~60%) won't move to the nrt cpuset. Do you see the same thing with cgroup v1 ?

Could it help to run your program (or a cgroup v2 compliant) in rc.local or earlier to minimize the number of threads/process that won't move ? Or will there always be threads/processes on every core ? I tried it, without much success.

Another problem I have is that I want to isolate a thread of a 3 thread process on the rt cpuset.

matslil commented 10 months ago

I'm currently not using this script myself, so I have limited time for it. What really would be needed is a test framework where you run (in containers?) a cgroup v1 system and a cgroup v2 system and makes sure it works in both as intended.

This is substantial amount of work, both to write the test frameworks and also to figure out what changes are needed to make it work for cgroup v2. I do not have that time.

But if you have a PR to provide, I can look at it. In that case, it would be preferable to split it up in stages, like:

  1. Make test framework and make sure it works for current implementation
  2. Make sure test framework can test for cgroup v2 as well. The framework will indicate an error, but that's fine. That's reality...
  3. Make a cgroup v2 implementation that makes the cgroup v2 framework pass the testing