[systemd-devel] [PATCH] systemd-cgroup-limits.patch

Patrascu, Cristian Cristian.Patrascu at windriver.com
Wed Jul 13 00:35:43 PDT 2011


Patch adds functionality to apply certain cgroups limits, such as shares of cpu, memory limit and blkio.
Unit files of type Service, Mount, Swap and Socket have new options (under corresponding [Service], [Mount], [Swap], [Socket] option group ):
- "MemoryHardLimit" accepts int64 value (considered bytes), puts the value in "memory" cgroup (if defined) in file "memory.limit_in_bytes" ;
- "MemoryLimit" accepts int64 value (considered bytes), puts the value in "memory" cgroup (if defined) in file "memory.soft_limit_in_bytes" ;
- "CPUShares" accepts in32 value (considered shares of cpu), puts the value in "cpu" cgroup (if defined - should be, by default systemd behaviour) in file "cpu.shares" ;
- "HddReadLimit" accepts string which specifies read limit for one or more physical disks. String should be in format: "<major>:<minor> <limit> [ ; <major>:<minor> <limit> ... ]". More disks limit can be specified with ";" . This option will put the value(s) in "blkio" control goup (if defined) in file "blkio.throttle.read_bps_device". Example: "8:0 2000000" limits to approx. 2MB/s read for disk 8:0.
- "HddWriteLimit" accepts string which specifies write limit for one or more physical disks. String should be in format: "<major>:<minor> <limit> [ ; <major>:<minor> <limit> ... ]". More disks limits can be specified with ";". This option will put the value(s) in "blkio" control goup (if defined) in file "blkio.throttle.write_bps_device". Example: "8:0 2000000" limits to approx. 2MB/s read for disk 8:0.

This patch is made for systemd-29 (branch v29 sha1: f9a61ef2c9e3b330d9e2e37977b3dd5758a4b853).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-systemd-cgroups-limits.patch
Type: text/x-patch
Size: 28010 bytes
Desc: 0001-systemd-cgroups-limits.patch
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110713/a6bf6e1a/attachment-0001.bin>


More information about the systemd-devel mailing list