linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cgroups v2: issues faced attempting to setup cpu limiting
@ 2019-07-23  4:28 Kaiwan N Billimoria
  0 siblings, 0 replies; 2+ messages in thread
From: Kaiwan N Billimoria @ 2019-07-23  4:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kaiwan N Billimoria, Tejun Heo, Peter Zijlstra (Intel),
	Waiman Long, Jens Axboe, Dennis Zhou, Al Viro

Hi All,

Am facing some issues getting CPU limiting working with cgroups v2. Pl read on
for the details; a solution is much appreciated!


Env: 5.0.0 Linux kernel on x86_64 Fedora 29

When attempting to setup CPU limiting using cgroups v2, I effectively
disabled cgroups v1 by passing

cgroup_no_v1=all

as a kernel cmdline option. That seems fine and now various controllers (cpu,
io, memory, ...) show up under /sys/fs/cgroup/unified/cgroup.controllers.

However, doing:

# mkdir /sys/fs/cgroup/unified/test1
# echo "+cpu " > /sys/fs/cgroup/unified/test1/cgroup.subtree_control
bash: echo: write error: No such file or directory
#

I understand that this is expected, as the man page on cgroups(7) mentions:

"... As at Linux 4.15, the cgroups v2 cpu controller does not support
control of realtime processes, and the controller can be enabled in the
root cgroup only if all realtime threads are in the root cgroup. (If there
are realtime processes in nonroot cgroups, then a write(2) of the string
"+cpu" to the cgroup.subtree_control file fails with the error EINVAL.
However, on some systems, systemd(1) places certain realtime processes in
nonroot cgroups in the v2 hierarchy. On such systems, these processes must
first be moved to the root cgroup before the cpu controller can be
enabled. ..."

My questions are (forgive them if too basic!): how exactly does one
'move realtime processes to the root cgroup'? What are the commands?

Next, how does one identify which processes? The ones that have sched policy
SCHED_FIFO or SCHED_RR? Would using a utility wrapper make this simpler?
(libcgroup, cgmanager, etc) - do they play well with cgroups2?

TIA!

Regards,
Kaiwan.
---
amazon author page: https://www.amazon.com/-/e/B07KNJSRJX

^ permalink raw reply	[flat|nested] 2+ messages in thread

* cgroups v2: issues faced attempting to setup cpu limiting
@ 2019-07-16 12:35 Kaiwan N Billimoria
  0 siblings, 0 replies; 2+ messages in thread
From: Kaiwan N Billimoria @ 2019-07-16 12:35 UTC (permalink / raw)
  To: linux-kernel

Hi,

Am facing some issues getting CPU limiting working with cgroups v2. Pl read on for the details;
a solution is much appreciated!


Env: custom 5.0.0 Linux kernel on x86_64 Fedora 29

When attempting to setup CPU limiting using cgroups v2, I effectively disabled cgroups v1 by passing

cgroup_no_v1=all

as a kernel cmdline option. That seems fine and now various controllers (cpu, io, memory, ...)
show up under /sys/fs/cgroup/unified/cgroup.controllers.

However, doing:

# mkdir /sys/fs/cgroup/unified/test1
# echo "+cpu " > /sys/fs/cgroup/unified/test1/cgroup.subtree_control
bash: echo: write error: No such file or directory
#

I understand that this is expected, as the man page on cgroups(7) mentions:

"... As at Linux 4.15, the cgroups v2 cpu controller does not support
control of realtime processes, and the controller can be enabled in the
root cgroup only if all realtime threads are in the root cgroup. (If there
are realtime processes in nonroot cgroups, then a write(2) of the string
"+cpu" to the cgroup.subtree_control file fails with the error EINVAL.
However, on some systems, systemd(1) places certain realtime processes in
nonroot cgroups in the v2 hierarchy. On such systems, these processes must
first be moved to the root cgroup before the cpu controller can be
enabled. ..."

My questions are: how exactly does one 'move realtime processes to the root cgroup'?
What are the commands?

Next, how does one identify which processes? The ones that have sched policy SCHED_FIFO
or SCHED_RR? Would using a utility wrapper make this simpler? (libcgroup, cgmanager,
etc) - do they play well with cgroups2?

TIA!

Regards,
Kaiwan.

amazon author page: https://www.amazon.com/-/e/B07KNJSRJX


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-23  4:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  4:28 cgroups v2: issues faced attempting to setup cpu limiting Kaiwan N Billimoria
  -- strict thread matches above, loose matches on Subject: below --
2019-07-16 12:35 Kaiwan N Billimoria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).