2016-04-24 17:49:13 +00:00
|
|
|
.\" Copyright (C) 2015 Serge Hallyn <serge@hallyn.com>
|
2016-04-25 07:55:02 +00:00
|
|
|
.\" and Copyright (C) 2016 Michael Kerrisk <mtk.manpages@gmail.com>
|
2016-04-24 17:49:13 +00:00
|
|
|
.\"
|
|
|
|
.\" %%%LICENSE_START(VERBATIM)
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\" %%%LICENSE_END
|
|
|
|
.\"
|
iconv.1, ldd.1, locale.1, localedef.1, memusage.1, memusagestat.1, mtrace.1, pldd.1, sprof.1, time.1, _syscall.2, add_key.2, alloc_hugepages.2, arch_prctl.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, connect.2, copy_file_range.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, fallocate.2, fanotify_init.2, fcntl.2, flock.2, fork.2, fsync.2, futex.2, futimesat.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, init_module.2, inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, intro.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl_console.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_getfsmap.2, ioctl_iflags.2, ioctl_list.2, ioctl_ns.2, ioctl_tty.2, ioctl_userfaultfd.2, ioperm.2, iopl.2, ioprio_set.2, ipc.2, kcmp.2, kexec_load.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open.2, open_by_handle_at.2, outb.2, perf_event_open.2, perfmonctl.2, personality.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readlink.2, readv.2, reboot.2, recv.2, recvmmsg.2, remap_file_pages.2, rename.2, request_key.2, restart_syscall.2, rt_sigqueueinfo.2, s390_pci_mmio_write.2, s390_runtime_instr.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, seccomp.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, sendmmsg.2, set_mempolicy.2, set_thread_area.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setns.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, signal.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, spu_create.2, spu_run.2, stat.2, statfs.2, statx.2, subpage_prot.2, swapon.2, symlink.2, sync.2, sync_file_range.2, syscall.2, syscalls.2, sysctl.2, sysfs.2, sysinfo.2, syslog.2, tee.2, time.2, timer_create.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, uname.2, unimplemented.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vfork.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3, __setfpucw.3, acos.3, acosh.3, adjtime.3, aio_fsync.3, aio_init.3, aio_read.3, aio_return.3, aio_suspend.3, aio_write.3, alloca.3, argz_add.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, backtrace.3, basename.3, bindresvport.3, bsd_signal.3, bsearch.3, bswap.3, btree.3, byteorder.3, bzero.3, canonicalize_file_name.3, carg.3, cbrt.3, ccos.3, ccosh.3, ceil.3, cexp.3, cfree.3, clearenv.3, clock.3, clock_getcpuclockid.3, clog.3, clog10.3, clog2.3, cmsg.3, confstr.3, copysign.3, cos.3, cosh.3, crypt.3, csin.3, csinh.3, csqrt.3, ctan.3, ctanh.3, ctime.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlerror.3, dlinfo.3, dlopen.3, dlsym.3, drand48.3, drand48_r.3, duplocale.3, encrypt.3, end.3, endian.3, envz_add.3, erf.3, erfc.3, err.3, errno.3, error.3, ether_aton.3, euidaccess.3, exec.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fcloseall.3, fdim.3, fenv.3, ferror.3, fexecve.3, fflush.3, ffs.3, fgetc.3, fgetgrent.3, fgetpwent.3, finite.3, floor.3, fma.3, fmax.3, fmemopen.3, fmin.3, fmod.3, fmtmsg.3, fopen.3, fopencookie.3, fpclassify.3, fpurge.3, fputwc.3, fputws.3, frexp.3, fseek.3, fseeko.3, ftime.3, fts.3, ftw.3, futimes.3, gamma.3, gcvt.3, get_nprocs_conf.3, get_phys_pages.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getentropy.3, getenv.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getlogin.3, getmntent.3, getnameinfo.3, getnetent.3, getnetent_r.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getrpcent_r.3, getrpcport.3, gets.3, getservent.3, getservent_r.3, getspnam.3, getsubopt.3, getttyent.3, getumask.3, getutent.3, getwchar.3, glob.3, gnu_get_libc_version.3, grantpt.3, gsignal.3, hash.3, hsearch.3, hypot.3, iconv.3, iconv_close.3, iconv_open.3, if_nameindex.3, if_nametoindex.3, ilogb.3, inet.3, inet_net_pton.3, inet_ntop.3, inet_pton.3, initgroups.3, insque.3, intro.3, isalpha.3, isgreater.3, j0.3, key_setsecret.3, killpg.3, ldexp.3, lgamma.3, lio_listio.3, lockf.3, log.3, log10.3, log1p.3, log2.3, logb.3, login.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, mkfifo.3, mkstemp.3, mktemp.3, modf.3, mpool.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, nextafter.3, nextup.3, nl_langinfo.3, ntp_gettime.3, offsetof.3, on_exit.3, open_memstream.3, opendir.3, openpty.3, perror.3, popen.3, posix_fallocate.3, posix_madvise.3, posix_memalign.3, posix_openpt.3, posix_spawn.3, pow.3, pow10.3, printf.3, profil.3, program_invocation_name.3, psignal.3, pthread_atfork.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_exit.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_testcancel.3, pthread_tryjoin_np.3, ptsname.3, putgrent.3, putpwent.3, qsort.3, random.3, random_r.3, rcmd.3, re_comp.3, readdir.3, realpath.3, recno.3, regex.3, remainder.3, remove.3, remquo.3, resolver.3, rexec.3, rint.3, round.3, rpc.3, rpmatch.3, rtime.3, scalb.3, scalbln.3, scandir.3, scanf.3, sched_getcpu.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_wait.3, setaliasent.3, setbuf.3, setenv.3, setlocale.3, setlogmask.3, setnetgrent.3, shm_open.3, signbit.3, significand.3, sigpause.3, sigqueue.3, sigset.3, sigvec.3, sin.3, sincos.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdarg.3, stdin.3, strcasecmp.3, strcat.3, strchr.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfmon.3, strfromd.3, strftime.3, strptime.3, strsignal.3, strstr.3, strtod.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, telldir.3, tempnam.3, termios.3, tgamma.3, timeradd.3, tmpnam.3, toupper.3, towlower.3, towupper.3, trunc.3, ttyslot.3, tzset.3, ualarm.3, ulimit.3, undocumented.3, unlocked_stdio.3, updwtmp.3, uselocale.3, usleep.3, wcrtomb.3, wcsdup.3, wcsnrtombs.3, wcsrtombs.3, wcstombs.3, wctob.3, wcwidth.3, wordexp.3, wprintf.3, xcrypt.3, xdr.3, y0.3, cciss.4, console_codes.4, dsp56k.4, fuse.4, hd.4, hpsa.4, initrd.4, intro.4, loop.4, random.4, rtc.4, sd.4, sk98lin.4, st.4, wavelan.4, acct.5, core.5, elf.5, filesystems.5, host.conf.5, hosts.5, locale.5, nologin.5, proc.5, resolv.conf.5, rpc.5, slabinfo.5, utmp.5, aio.7, arp.7, bootparam.7, capabilities.7, cgroup_namespaces.7, cgroups.7, charsets.7, cpuset.7, ddp.7, environ.7, epoll.7, fanotify.7, feature_test_macros.7, futex.7, inode.7, inotify.7, ip.7, ipv6.7, keyrings.7, locale.7, man-pages.7, man.7, math_error.7, mount_namespaces.7, mq_overview.7, namespaces.7, netdevice.7, netlink.7, packet.7, pipe.7, pkeys.7, pthreads.7, pty.7, raw.7, rtld-audit.7, rtnetlink.7, sched.7, session-keyring.7, signal.7, sock_diag.7, socket.7, spufs.7, suffixes.7, tcp.7, udp.7, udplite.7, unicode.7, units.7, unix.7, uri.7, user_namespaces.7, vdso.7, x25.7, xattr.7, iconvconfig.8, ld.so.8, ldconfig.8, sln.8: Update timestamps
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-09-15 10:44:56 +00:00
|
|
|
.TH CGROUPS 7 2017-09-15 "Linux" "Linux Programmer's Manual"
|
2016-04-24 18:26:50 +00:00
|
|
|
.SH NAME
|
|
|
|
cgroups \- Linux control groups
|
|
|
|
.SH DESCRIPTION
|
|
|
|
Control cgroups, usually referred to as cgroups,
|
2016-10-08 13:58:36 +00:00
|
|
|
are a Linux kernel feature which allow processes to
|
2016-10-05 12:28:25 +00:00
|
|
|
be organized into hierarchical groups whose usage of
|
|
|
|
various types of resources can then be limited and monitored.
|
|
|
|
The kernel's cgroup interface is provided through
|
2016-04-24 18:26:50 +00:00
|
|
|
a pseudo-filesystem called cgroupfs.
|
2016-10-02 14:36:38 +00:00
|
|
|
Grouping is implemented in the core cgroup kernel code,
|
2016-04-24 18:26:50 +00:00
|
|
|
while resource tracking and limits are implemented in
|
2016-10-05 12:28:25 +00:00
|
|
|
a set of per-resource-type subsystems (memory, CPU, and so on).
|
2016-04-24 18:26:50 +00:00
|
|
|
.\"
|
2016-04-25 08:24:09 +00:00
|
|
|
.SS Terminology
|
|
|
|
A
|
|
|
|
.I cgroup
|
|
|
|
is a collection of processes that are bound to a set of
|
|
|
|
limits or parameters defined via the cgroup filesystem.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-04-25 08:24:09 +00:00
|
|
|
A
|
|
|
|
.I subsystem
|
|
|
|
is a kernel component that modifies the behavior of
|
|
|
|
the processes in a cgroup.
|
|
|
|
Various subsystems have been implemented, making it possible to do things
|
|
|
|
such as limiting the amount of CPU time and memory available to a cgroup,
|
|
|
|
accounting for the CPU time used by a cgroup,
|
|
|
|
and freezing and resuming execution of the processes in a cgroup.
|
|
|
|
Subsystems are sometimes also known as
|
|
|
|
.IR "resource controllers"
|
|
|
|
(or simply, controllers).
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 09:46:40 +00:00
|
|
|
The cgroups for a controller are arranged in a
|
2016-04-25 08:24:09 +00:00
|
|
|
.IR hierarchy .
|
|
|
|
This hierarchy is defined by creating, removing, and
|
|
|
|
renaming subdirectories within the cgroup filesystem.
|
2016-10-05 12:35:14 +00:00
|
|
|
At each level of the hierarchy, attributes (e.g., limits) can be defined.
|
|
|
|
The limits, control, and accounting provided by cgroups generally have
|
|
|
|
effect throughout the subhierarchy underneath the cgroup where the
|
|
|
|
attributes are defined.
|
2016-10-05 12:28:25 +00:00
|
|
|
Thus, for example, the limits placed on
|
|
|
|
a cgroup at a higher level in the hierarchy cannot be exceeded
|
|
|
|
by descendant cgroups.
|
2016-04-25 08:24:09 +00:00
|
|
|
.\"
|
2016-04-25 07:55:02 +00:00
|
|
|
.SS Cgroups version 1 and version 2
|
|
|
|
The initial release of the cgroups implementation was in Linux 2.6.24.
|
2016-10-07 09:46:40 +00:00
|
|
|
Over time, various cgroup controllers have been added
|
2016-04-25 07:55:02 +00:00
|
|
|
to allow the management of various types of resources.
|
2016-10-07 09:46:40 +00:00
|
|
|
However, the development of these controllers was largely uncoordinated,
|
|
|
|
with the result that many inconsistencies arose between controllers
|
2016-04-25 07:55:02 +00:00
|
|
|
and management of the cgroup hierarchies became rather complex.
|
|
|
|
(A longer description of these problems can be found in
|
|
|
|
the kernel source file
|
2016-04-25 11:09:01 +00:00
|
|
|
.IR Documentation/cgroup\-v2.txt .)
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-06-20 12:03:42 +00:00
|
|
|
Because of the problems with the initial cgroups implementation
|
|
|
|
(cgroups version 1),
|
2016-04-25 07:55:02 +00:00
|
|
|
starting in Linux 3.10, work began on a new,
|
|
|
|
orthogonal implementation to remedy these problems.
|
|
|
|
Initially marked experimental, and hidden behind the
|
|
|
|
.I "\-o\ __DEVEL__sane_behavior"
|
|
|
|
mount option, the new version (cgroups version 2)
|
|
|
|
was eventually made official with the release of Linux 4.5.
|
|
|
|
Differences between the two versions are described in the text below.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-04-25 07:55:02 +00:00
|
|
|
Although cgroups v2 is intended as a replacement for cgroups v1,
|
|
|
|
the older system continues to exist
|
|
|
|
(and for compatibility reasons is unlikely to be removed).
|
|
|
|
Currently, cgroups v2 implements only a subset of the controllers
|
|
|
|
available in cgroups v1.
|
|
|
|
The two systems are implemented so that both v1 controllers and
|
|
|
|
v2 controllers can be mounted on the same system.
|
|
|
|
Thus, for example, it is possible to use those controllers
|
|
|
|
that are supported under version 2,
|
|
|
|
while also using version 1 controllers
|
|
|
|
where version 2 does not yet support those controllers.
|
2016-10-07 09:39:38 +00:00
|
|
|
The only restriction here is that a controller can't be simultaneously
|
|
|
|
employed in both a cgroups v1 hierarchy and in the cgroups v2 hierarchy.
|
2016-04-25 07:55:02 +00:00
|
|
|
.\"
|
2016-10-05 12:28:25 +00:00
|
|
|
.SS Cgroups version 1
|
|
|
|
Under cgroups v1, each controller may be mounted against a separate
|
|
|
|
cgroup filesystem that provides its own hierarchical organization of the
|
|
|
|
processes on the system.
|
|
|
|
It is also possible comount multiple (or even all) cgroups v1 controllers
|
|
|
|
against the same cgroup filesystem, meaning that the comounted controllers
|
|
|
|
manage the same hierarchical organization of processes.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-05 12:28:25 +00:00
|
|
|
For each mounted hierarchy,
|
|
|
|
the directory tree mirrors the control group hierarchy.
|
|
|
|
Each control group is represented by a directory, with each of its child
|
|
|
|
control cgroups represented as a child directory.
|
|
|
|
For instance,
|
|
|
|
.IR /user/joe/1.session
|
|
|
|
represents control group
|
|
|
|
.IR 1.session ,
|
|
|
|
which is a child of cgroup
|
|
|
|
.IR joe ,
|
|
|
|
which is a child of
|
|
|
|
.IR /user .
|
|
|
|
Under each cgroup directory is a set of files which can be read or
|
|
|
|
written to, reflecting resource limits and a few general cgroup
|
|
|
|
properties.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-05 12:28:25 +00:00
|
|
|
In addition, in cgroups v1,
|
2016-10-07 09:46:40 +00:00
|
|
|
cgroups can be mounted with no bound controller, in which case
|
2016-10-05 12:28:25 +00:00
|
|
|
they serve only to track processes.
|
2016-10-07 11:00:52 +00:00
|
|
|
(See the discussion of release notification below.)
|
2016-10-05 12:28:25 +00:00
|
|
|
An example of this is the
|
|
|
|
.I name=systemd
|
|
|
|
cgroup which is used by
|
|
|
|
.BR systemd (1)
|
|
|
|
to track services and user sessions.
|
|
|
|
.\"
|
2016-10-02 14:36:38 +00:00
|
|
|
.SS Tasks (threads) versus processes
|
2016-04-25 08:28:23 +00:00
|
|
|
In cgroups v1, a distinction is drawn between
|
|
|
|
.I processes
|
|
|
|
and
|
|
|
|
.IR tasks .
|
|
|
|
In this view, a process can consist of multiple tasks
|
2016-10-02 14:36:38 +00:00
|
|
|
(more commonly called threads, from a user-space perspective,
|
|
|
|
and called such in the remainder of this man page).
|
2016-07-27 12:33:30 +00:00
|
|
|
In cgroups v1, it is possible to independently manipulate
|
2016-10-02 14:36:38 +00:00
|
|
|
the cgroup memberships of the threads in a process.
|
2016-04-25 08:28:23 +00:00
|
|
|
Because this ability caused certain problems,
|
|
|
|
.\" FIXME Add some text describing why this was a problem.
|
|
|
|
the ability to independently manipulate the cgroup memberships
|
2016-10-02 14:36:38 +00:00
|
|
|
of the threads in a process has been removed in cgroups v2.
|
2016-04-25 08:28:23 +00:00
|
|
|
Cgroups v2 allows manipulation of cgroup membership only for processes
|
|
|
|
(which has the effect of changing the cgroup membership of
|
2016-10-02 14:36:38 +00:00
|
|
|
all threads in the process).
|
2016-04-25 08:28:23 +00:00
|
|
|
.\"
|
2016-10-07 10:44:06 +00:00
|
|
|
.SS Mounting v1 controllers
|
|
|
|
The use of cgroups requires a kernel built with the
|
2016-12-27 19:30:50 +00:00
|
|
|
.BR CONFIG_CGROUP
|
|
|
|
option.
|
2016-10-07 10:44:06 +00:00
|
|
|
In addition, each of the v1 controllers has an associated
|
|
|
|
configuration option that must be set in order to employ that controller.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
In order to use a v1 controller,
|
|
|
|
it must be mounted against a cgroup filesystem.
|
fallocate.2, fcntl.2, lseek.2, madvise.2, memfd_create.2, mmap.2, remap_file_pages.2, swapon.2, proc.5, cgroups.7, shm_overview.7, user_namespaces.7: Fix cross references to new tmpfs(5) page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-07 14:50:02 +00:00
|
|
|
The usual place for such mounts is under a
|
|
|
|
.BR tmpfs (5)
|
|
|
|
filesystem mounted at
|
2016-10-07 10:44:06 +00:00
|
|
|
.IR /sys/fs/cgroup .
|
|
|
|
Thus, one might mount the
|
|
|
|
.I cpu
|
|
|
|
controller as follows:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2016-10-07 10:44:06 +00:00
|
|
|
mount \-t cgroup \-o cpu none /sys/fs/cgroup/cpu
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
ioctl_console.2, ioctl_getfsmap.2, ioctl_iflags.2, ioctl_list.2, ioctl_ns.2, kcmp.2, kexec_load.2, keyctl.2, link.2, mmap.2, modify_ldt.2, msgctl.2, poll.2, query_module.2, quotactl.2, recv.2, recvmmsg.2, sched_setscheduler.2, seccomp.2, select.2, semctl.2, semop.2, send.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sysinfo.2, timer_create.2, timerfd_create.2, uname.2, unshare.2, userfaultfd.2, ustat.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, backtrace.3, bswap.3, btree.3, clock_getcpuclockid.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, fmemopen.3, fopencookie.3, frexp.3, fts.3, ftw.3, getaddrinfo.3, getaddrinfo_a.3, getcontext.3, getgrouplist.3, getifaddrs.3, getipnodebyname.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getrpcent.3, getservent_r.3, getttyent.3, getumask.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, inet.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallopt.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, posix_openpt.3, printf.3, pthread_setname_np.3, pthread_setschedparam.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, sigvec.3, stdarg.3, strcat.3, strcpy.3, strftime.3, strtol.3, toupper.3, ttyslot.3, fuse.4, loop.4, st.4, elf.5, cgroup_namespaces.7, cgroups.7, feature_test_macros.7, inode.7, inotify.7, keyrings.7, man-pages.7, math_error.7, mount_namespaces.7, mq_overview.7, pthreads.7, sched.7, session-keyring.7, udplite.7, unix.7, vdso.7: Use consistent markup for code snippets
The preferred form is
.PP/.IP
.in +4n
.EX
<code>
.EE
.in
.PP/.IP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:37:55 +00:00
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
It is possible to comount multiple controllers against the same hierarchy.
|
|
|
|
For example, here the
|
|
|
|
.IR cpu
|
2016-04-24 18:26:50 +00:00
|
|
|
and
|
2016-10-07 10:44:06 +00:00
|
|
|
.IR cpuacct
|
|
|
|
controllers are comounted against a single hierarchy:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-04-24 18:26:50 +00:00
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2016-10-07 10:44:06 +00:00
|
|
|
mount \-t cgroup \-o cpu,cpuacct none /sys/fs/cgroup/cpu,cpuacct
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
ioctl_console.2, ioctl_getfsmap.2, ioctl_iflags.2, ioctl_list.2, ioctl_ns.2, kcmp.2, kexec_load.2, keyctl.2, link.2, mmap.2, modify_ldt.2, msgctl.2, poll.2, query_module.2, quotactl.2, recv.2, recvmmsg.2, sched_setscheduler.2, seccomp.2, select.2, semctl.2, semop.2, send.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sysinfo.2, timer_create.2, timerfd_create.2, uname.2, unshare.2, userfaultfd.2, ustat.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, backtrace.3, bswap.3, btree.3, clock_getcpuclockid.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, fmemopen.3, fopencookie.3, frexp.3, fts.3, ftw.3, getaddrinfo.3, getaddrinfo_a.3, getcontext.3, getgrouplist.3, getifaddrs.3, getipnodebyname.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getrpcent.3, getservent_r.3, getttyent.3, getumask.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, inet.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallopt.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, posix_openpt.3, printf.3, pthread_setname_np.3, pthread_setschedparam.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, sigvec.3, stdarg.3, strcat.3, strcpy.3, strftime.3, strtol.3, toupper.3, ttyslot.3, fuse.4, loop.4, st.4, elf.5, cgroup_namespaces.7, cgroups.7, feature_test_macros.7, inode.7, inotify.7, keyrings.7, man-pages.7, math_error.7, mount_namespaces.7, mq_overview.7, pthreads.7, sched.7, session-keyring.7, udplite.7, unix.7, vdso.7: Use consistent markup for code snippets
The preferred form is
.PP/.IP
.in +4n
.EX
<code>
.EE
.in
.PP/.IP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:37:55 +00:00
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 09:46:40 +00:00
|
|
|
Comounting controllers has the effect that a process is in the same cgroup for
|
2016-10-07 10:44:06 +00:00
|
|
|
all of the comounted controllers.
|
2016-10-07 09:46:40 +00:00
|
|
|
Separately mounting controllers allows a process to
|
2016-04-24 18:26:50 +00:00
|
|
|
be in cgroup
|
|
|
|
.I /foo1
|
2016-10-07 09:46:40 +00:00
|
|
|
for one controller while being in
|
2016-04-24 18:26:50 +00:00
|
|
|
.I /foo2/foo3
|
|
|
|
for another.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
It is possible to comount all v1 controllers against the same hierarchy:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2016-10-07 10:44:06 +00:00
|
|
|
mount \-t cgroup \-o all cgroup /sys/fs/cgroup
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
ioctl_console.2, ioctl_getfsmap.2, ioctl_iflags.2, ioctl_list.2, ioctl_ns.2, kcmp.2, kexec_load.2, keyctl.2, link.2, mmap.2, modify_ldt.2, msgctl.2, poll.2, query_module.2, quotactl.2, recv.2, recvmmsg.2, sched_setscheduler.2, seccomp.2, select.2, semctl.2, semop.2, send.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sysinfo.2, timer_create.2, timerfd_create.2, uname.2, unshare.2, userfaultfd.2, ustat.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, backtrace.3, bswap.3, btree.3, clock_getcpuclockid.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, fmemopen.3, fopencookie.3, frexp.3, fts.3, ftw.3, getaddrinfo.3, getaddrinfo_a.3, getcontext.3, getgrouplist.3, getifaddrs.3, getipnodebyname.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getrpcent.3, getservent_r.3, getttyent.3, getumask.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, inet.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallopt.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, posix_openpt.3, printf.3, pthread_setname_np.3, pthread_setschedparam.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, sigvec.3, stdarg.3, strcat.3, strcpy.3, strftime.3, strtol.3, toupper.3, ttyslot.3, fuse.4, loop.4, st.4, elf.5, cgroup_namespaces.7, cgroups.7, feature_test_macros.7, inode.7, inotify.7, keyrings.7, man-pages.7, math_error.7, mount_namespaces.7, mq_overview.7, pthreads.7, sched.7, session-keyring.7, udplite.7, unix.7, vdso.7: Use consistent markup for code snippets
The preferred form is
.PP/.IP
.in +4n
.EX
<code>
.EE
.in
.PP/.IP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:37:55 +00:00
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
(One can achieve the same result by omitting
|
|
|
|
.IR "\-o all" ,
|
|
|
|
since it is the default if no controllers are explicitly specified.)
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 11:52:19 +00:00
|
|
|
It is not possible to mount the same controller
|
|
|
|
against multiple cgroup hierarchies.
|
|
|
|
For example, it is not possible to mount both the
|
|
|
|
.I cpu
|
|
|
|
and
|
|
|
|
.I cpuacct
|
|
|
|
controllers against one hierarchy, and to mount the
|
|
|
|
.I cpu
|
|
|
|
controller alone against another hierarchy.
|
|
|
|
It is possible to create multiple mount points with exactly
|
|
|
|
the same set of comounted controllers.
|
|
|
|
However, in this case all that results is multiple mount points
|
|
|
|
providing a view of the same hierarchy.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 10:44:06 +00:00
|
|
|
Note that on many systems, the v1 controllers are automatically mounted under
|
|
|
|
.IR /sys/fs/cgroup ;
|
|
|
|
in particular,
|
|
|
|
.BR systemd (1)
|
|
|
|
automatically creates such mount points.
|
2016-04-24 18:26:50 +00:00
|
|
|
.\"
|
2017-12-23 09:27:11 +00:00
|
|
|
.SS Unmounting v1 controllers
|
|
|
|
A mounted cgroup filesystem can be unmounted using the
|
|
|
|
.BR umount (8)
|
|
|
|
command, as in the following example:
|
|
|
|
.PP
|
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
umount /sys/fs/cgroup/pids
|
|
|
|
.EE
|
|
|
|
.in
|
|
|
|
.PP
|
|
|
|
.IR "But note well" :
|
|
|
|
a cgroup filesystem is unmounted only if it is not busy,
|
|
|
|
that is, it has no child cgroups.
|
|
|
|
If this is not the case, then the only effect of the
|
|
|
|
.BR umount (8)
|
|
|
|
is to make the mount invisible.
|
|
|
|
Thus, to ensure that the mount point is really removed,
|
|
|
|
one must first remove all child cgroups,
|
|
|
|
which in turn can be done only after all member processes
|
|
|
|
have been moved from those cgroups to the root cgroup.
|
|
|
|
.\"
|
2016-10-07 14:01:43 +00:00
|
|
|
.SS Cgroups version 1 controllers
|
|
|
|
Each of the cgroups version 1 controllers is governed
|
|
|
|
by a kernel configuration option (listed below).
|
|
|
|
Additionally, the availability of the cgroups feature is governed by the
|
|
|
|
.BR CONFIG_CGROUPS
|
|
|
|
kernel configuration option.
|
|
|
|
.TP
|
|
|
|
.IR cpu " (since Linux 2.6.24; " \fBCONFIG_CGROUP_SCHED\fP )
|
|
|
|
Cgroups can be guaranteed a minimum number of "CPU shares"
|
|
|
|
when a system is busy.
|
|
|
|
This does not limit a cgroup's CPU usage if the CPUs are not busy.
|
2016-11-27 13:44:24 +00:00
|
|
|
For further information, see
|
|
|
|
.IR Documentation/scheduler/sched-design-CFS.txt .
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-11-27 13:44:24 +00:00
|
|
|
In Linux 3.2,
|
|
|
|
this controller was extended to provide CPU "bandwidth" control.
|
|
|
|
If the kernel is configured with
|
2016-12-30 18:26:53 +00:00
|
|
|
.BR CONFIG_CFS_BANDWIDTH ,
|
2016-11-27 13:44:24 +00:00
|
|
|
then within each scheduling period
|
|
|
|
(defined via a file in the cgroup directory), it is possible to define
|
|
|
|
an upper limit on the CPU time allocated to the processes in a cgroup.
|
|
|
|
This upper limit applies even if there is no other competition for the CPU.
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/scheduler/sched\-bwc.txt .
|
|
|
|
.TP
|
|
|
|
.IR cpuacct " (since Linux 2.6.24; " \fBCONFIG_CGROUP_CPUACCT\fP )
|
|
|
|
This provides accounting for CPU usage by groups of processes.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup\-v1/cpuacct.txt .
|
|
|
|
.TP
|
|
|
|
.IR cpuset " (since Linux 2.6.24; " \fBCONFIG_CPUSETS\fP )
|
|
|
|
This cgroup can be used to bind the processes in a cgroup to
|
|
|
|
a specified set of CPUs and NUMA nodes.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup\-v1/cpusets.txt .
|
|
|
|
.TP
|
|
|
|
.IR memory " (since Linux 2.6.25; " \fBCONFIG_MEMCG\fP )
|
|
|
|
The memory controller supports reporting and limiting of process memory, kernel
|
|
|
|
memory, and swap used by cgroups.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup\-v1/memory.txt .
|
|
|
|
.TP
|
|
|
|
.IR devices " (since Linux 2.6.26; " \fBCONFIG_CGROUP_DEVICE\fP )
|
|
|
|
This supports controlling which processes may create (mknod) devices as
|
|
|
|
well as open them for reading or writing.
|
|
|
|
The policies may be specified as whitelists and blacklists.
|
|
|
|
Hierarchy is enforced, so new rules must not
|
|
|
|
violate existing rules for the target or ancestor cgroups.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/devices.txt .
|
|
|
|
.TP
|
|
|
|
.IR freezer " (since Linux 2.6.28; " \fBCONFIG_CGROUP_FREEZER\fP )
|
|
|
|
The
|
|
|
|
.IR freezer
|
|
|
|
cgroup can suspend and restore (resume) all processes in a cgroup.
|
|
|
|
Freezing a cgroup
|
|
|
|
.I /A
|
|
|
|
also causes its children, for example, processes in
|
|
|
|
.IR /A/B ,
|
|
|
|
to be frozen.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/freezer-subsystem.txt .
|
|
|
|
.TP
|
|
|
|
.IR net_cls " (since Linux 2.6.29; " \fBCONFIG_CGROUP_NET_CLASSID\fP )
|
|
|
|
This places a classid, specified for the cgroup, on network packets
|
|
|
|
created by a cgroup.
|
|
|
|
These classids can then be used in firewall rules,
|
|
|
|
as well as used to shape traffic using
|
|
|
|
.BR tc (8).
|
|
|
|
This applies only to packets
|
|
|
|
leaving the cgroup, not to traffic arriving at the cgroup.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/net_cls.txt .
|
|
|
|
.TP
|
|
|
|
.IR blkio " (since Linux 2.6.33; " \fBCONFIG_BLK_CGROUP\fP )
|
|
|
|
The
|
|
|
|
.I blkio
|
|
|
|
cgroup controls and limits access to specified block devices by
|
|
|
|
applying IO control in the form of throttling and upper limits against leaf
|
|
|
|
nodes and intermediate nodes in the storage hierarchy.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Two policies are available.
|
|
|
|
The first is a proportional-weight time-based division
|
|
|
|
of disk implemented with CFQ.
|
|
|
|
This is in effect for leaf nodes using CFQ.
|
|
|
|
The second is a throttling policy which specifies
|
|
|
|
upper I/O rate limits on a device.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/blkio-controller.txt .
|
|
|
|
.TP
|
|
|
|
.IR perf_event " (since Linux 2.6.39; " \fBCONFIG_CGROUP_PERF\fP )
|
|
|
|
This controller allows
|
|
|
|
.I perf
|
|
|
|
monitoring of the set of processes grouped in a cgroup.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
2016-10-22 11:50:22 +00:00
|
|
|
.IR tools/perf/Documentation/perf-record.txt .
|
2016-10-07 14:01:43 +00:00
|
|
|
.TP
|
|
|
|
.IR net_prio " (since Linux 3.3; " \fBCONFIG_CGROUP_NET_PRIO\fP )
|
|
|
|
This allows priorities to be specified, per network interface, for cgroups.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/net_prio.txt .
|
|
|
|
.TP
|
|
|
|
.IR hugetlb " (since Linux 3.5; " \fBCONFIG_CGROUP_HUGETLB\fP )
|
|
|
|
This supports limiting the use of huge pages by cgroups.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/hugetlb.txt .
|
|
|
|
.TP
|
|
|
|
.IR pids " (since Linux 4.3; " \fBCONFIG_CGROUP_PIDS\fP )
|
|
|
|
This controller permits limiting the number of process that may be created
|
|
|
|
in a cgroup (and its descendants).
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-10-07 14:01:43 +00:00
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/pids.txt .
|
2017-12-15 07:25:10 +00:00
|
|
|
.TP
|
|
|
|
.IR rdma " (since Linux 4.11; " \fBCONFIG_CGROUP_RDMA\fP )
|
2017-12-18 16:14:49 +00:00
|
|
|
The RDMA controller permits limiting the use of
|
|
|
|
RDMA/IB-specific resources per cgroup.
|
2017-12-15 07:25:10 +00:00
|
|
|
.IP
|
|
|
|
Further information can be found in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v1/rdma.txt .
|
2016-10-07 14:01:43 +00:00
|
|
|
.\"
|
2016-10-02 14:36:38 +00:00
|
|
|
.SS Creating cgroups and moving processes
|
2016-10-07 11:03:20 +00:00
|
|
|
A cgroup filesystem initially contains a single root cgroup, '/',
|
2016-10-02 14:36:38 +00:00
|
|
|
which all processes belong to.
|
2016-04-24 18:26:50 +00:00
|
|
|
A new cgroup is created by creating a directory in the cgroup filesystem:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2017-12-23 08:09:26 +00:00
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
mkdir /sys/fs/cgroup/cpu/cg1
|
|
|
|
.EE
|
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-04-24 18:26:50 +00:00
|
|
|
This creates a new empty cgroup.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 12:04:43 +00:00
|
|
|
A process may be moved to this cgroup by writing its PID into the cgroup's
|
2016-04-24 18:26:50 +00:00
|
|
|
.I cgroup.procs
|
|
|
|
file:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2017-12-23 08:09:26 +00:00
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
echo $$ > /sys/fs/cgroup/cpu/cg1/cgroup.procs
|
|
|
|
.EE
|
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 12:04:43 +00:00
|
|
|
Only one PID at a time should be written to this file.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 12:04:43 +00:00
|
|
|
Writing the value 0 to a
|
|
|
|
.IR cgroup.procs
|
|
|
|
file causes the writing process to be moved to the corresponding cgroup.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-02 14:36:38 +00:00
|
|
|
When writing a PID into the
|
|
|
|
.IR cgroup.procs ,
|
2016-10-07 11:10:31 +00:00
|
|
|
all threads in the process are moved into the new cgroup at once.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 12:04:43 +00:00
|
|
|
Within a hierarchy, a process can be a member of exactly one cgroup.
|
|
|
|
Writing a process's PID to a
|
|
|
|
.IR cgroup.procs
|
|
|
|
file automatically removes it from the cgroup of
|
|
|
|
which it was previously a member.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 12:04:43 +00:00
|
|
|
The
|
|
|
|
.I cgroup.procs
|
|
|
|
file can be read to obtain a list of the processes that are
|
|
|
|
members of a cgroup.
|
|
|
|
The returned list of PIDs is not guaranteed to be in order.
|
|
|
|
Nor is it guaranteed to be free of duplicates.
|
|
|
|
(For example, a PID may be recycled while reading from the list.)
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 11:10:31 +00:00
|
|
|
In cgroups v1 (but not cgroups v2), an individual thread can be moved to
|
|
|
|
another cgroup by writing its thread ID
|
|
|
|
(i.e., the kernel thread ID returned by
|
|
|
|
.BR clone (2)
|
|
|
|
and
|
|
|
|
.BR gettid (2))
|
|
|
|
to the
|
|
|
|
.IR tasks
|
|
|
|
file in a cgroup directory.
|
|
|
|
This file can be read to discover the set of threads
|
|
|
|
that are members of the cgroup.
|
|
|
|
This file is not present in cgroup v2 directories.
|
2016-10-07 11:24:07 +00:00
|
|
|
.\"
|
|
|
|
.SS Removing cgroups
|
|
|
|
To remove a cgroup,
|
|
|
|
it must first have no child cgroups and contain no (nonzombie) processes.
|
|
|
|
So long as that is the case, one can simply
|
|
|
|
remove the corresponding directory pathname.
|
|
|
|
Note that files in a cgroup directory cannot and need not be
|
|
|
|
removed.
|
|
|
|
.\"
|
2016-10-07 14:15:06 +00:00
|
|
|
.SS Cgroups v1 release notification
|
2016-10-07 14:33:08 +00:00
|
|
|
Two files can be used to determine whether the kernel provides
|
|
|
|
notifications when a cgroup becomes empty.
|
|
|
|
A cgroup is considered to be empty when it contains no child
|
|
|
|
cgroups and no member processes.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 14:33:08 +00:00
|
|
|
A special file in the root directory of each cgroup hierarchy,
|
2016-10-07 14:15:06 +00:00
|
|
|
.IR release_agent ,
|
2016-10-07 14:33:08 +00:00
|
|
|
can be used to register the pathname of a program that may be invoked when
|
|
|
|
a cgroup in the hierarchy becomes empty.
|
|
|
|
The pathname of the newly empty cgroup (relative to the cgroup mount point)
|
|
|
|
is provided as the sole command-line argument when the
|
|
|
|
.IR release_agent
|
|
|
|
program is invoked.
|
|
|
|
The
|
|
|
|
.IR release_agent
|
|
|
|
program might remove the cgroup directory,
|
|
|
|
or perhaps repopulate with a process.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 14:33:08 +00:00
|
|
|
The default value of the
|
|
|
|
.IR release_agent
|
|
|
|
file is empty, meaning that no release agent is invoked.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 14:33:08 +00:00
|
|
|
Whether or not the
|
|
|
|
.IR release_agent
|
|
|
|
program is invoked when a particular cgroup becomes empty is determined
|
|
|
|
by the value in the
|
2016-10-07 14:15:06 +00:00
|
|
|
.IR notify_on_release
|
2016-10-07 14:33:08 +00:00
|
|
|
file in the corresponding cgroup directory.
|
|
|
|
If this file contains the value 0, then the
|
|
|
|
.IR release_agent
|
|
|
|
program is not invoked.
|
|
|
|
If it contains the value 1, the
|
|
|
|
.IR release_agent
|
|
|
|
program is invoked.
|
|
|
|
The default value for this file in the root cgroup is 0.
|
|
|
|
At the time when a new cgroup is created,
|
|
|
|
the value in this file is inherited from the corresponding file
|
|
|
|
in the parent cgroup.
|
2016-10-07 14:15:06 +00:00
|
|
|
.\"
|
2016-10-07 11:24:07 +00:00
|
|
|
.SS Cgroups version 2
|
|
|
|
In cgroups v2,
|
|
|
|
all mounted controllers reside in a single unified hierarchy.
|
|
|
|
While (different) controllers may be simultaneously
|
|
|
|
mounted under the v1 and v2 hierarchies,
|
|
|
|
it is not possible to mount the same controller simultaneously
|
|
|
|
under both the v1 and the v2 hierarchies.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 15:02:32 +00:00
|
|
|
The new behaviors in cgroups v2 are summarized here,
|
|
|
|
and in some cases elaborated in the following subsections.
|
|
|
|
.IP 1. 3
|
2016-10-08 13:58:36 +00:00
|
|
|
Cgroups v2 provides a unified hierarchy against
|
2016-10-07 17:56:38 +00:00
|
|
|
which all controllers are mounted.
|
|
|
|
.IP 2.
|
2016-10-07 15:02:32 +00:00
|
|
|
"Internal" processes are not permitted.
|
|
|
|
With the exception of the root cgroup, processes may reside
|
|
|
|
only in leaf nodes (cgroups that do not themselves contain child cgroups).
|
2016-10-07 17:56:38 +00:00
|
|
|
.IP 3.
|
2016-10-07 15:02:32 +00:00
|
|
|
Active cgroups must be specified via the files
|
|
|
|
.IR cgroup.controllers
|
|
|
|
and
|
|
|
|
.IR cgroup.subtree_control .
|
2016-10-07 17:56:38 +00:00
|
|
|
.IP 4.
|
2016-10-07 15:02:32 +00:00
|
|
|
The
|
|
|
|
.I tasks
|
|
|
|
file has been removed.
|
|
|
|
In addition, the
|
|
|
|
.I cgroup.clone_children
|
|
|
|
file that is employed by the
|
|
|
|
.I cpuset
|
|
|
|
controller has been removed.
|
2016-10-07 17:56:38 +00:00
|
|
|
.IP 5.
|
2016-10-07 15:02:32 +00:00
|
|
|
An improved mechanism for notification of empty cgroups is provided by the
|
|
|
|
.IR cgroup.events
|
|
|
|
file.
|
|
|
|
.PP
|
|
|
|
For more changes, see the
|
|
|
|
.I Documentation/cgroup-v2.txt
|
|
|
|
file in the kernel source.
|
|
|
|
.\"
|
2016-10-07 17:56:38 +00:00
|
|
|
.SS Cgroups v2 unified hierarchy
|
|
|
|
In cgroups v1, the ability to mount different controllers
|
|
|
|
against different hierarchies was intended to allow great flexibility
|
|
|
|
for application design.
|
|
|
|
In practice, though, the flexibility turned out to less useful than expected,
|
|
|
|
and in many cases added complexity.
|
|
|
|
Therefore, in cgroups v2,
|
|
|
|
all available controllers are mounted against a single hierarchy.
|
|
|
|
The available controllers are automatically mounted,
|
|
|
|
meaning that it is not necessary (or possible) to specify the controllers
|
|
|
|
when mounting the cgroup v2 filesystem using a command such as the following:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2017-12-23 08:09:26 +00:00
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
mount -t cgroup2 none /mnt/cgroup2
|
|
|
|
.EE
|
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 17:56:38 +00:00
|
|
|
A cgroup v2 controller is available only if it is not currently in use
|
|
|
|
via a mount against a cgroup v1 hierarchy.
|
|
|
|
Or, to put things another way, it is not possible to employ
|
|
|
|
the same controller against both a v1 hierarchy and the unified v2 hierarchy.
|
2017-12-23 09:58:08 +00:00
|
|
|
This means that it may be necessary first to unmount a v1 controller
|
|
|
|
(as described above) before that controller is available in v2.
|
|
|
|
Since
|
|
|
|
.BR systemd (1)
|
|
|
|
makes heavy use of some v1 controllers by default,
|
|
|
|
it can in some cases be simpler to boot the system with
|
|
|
|
selected v1 controllers disabled.
|
|
|
|
To do this, specify the
|
|
|
|
.IR cgroup_no_v1=list
|
|
|
|
option on the kernel boot command line;
|
|
|
|
.I list
|
|
|
|
is a comma-separated list of the names of the controllers to disable,
|
|
|
|
or the word
|
|
|
|
.I all
|
|
|
|
to disable all v1 controllers.
|
|
|
|
(This situation is correctly handled by
|
|
|
|
.BR systemd (1),
|
|
|
|
which falls back to operating without the specified controllers.)
|
2017-12-23 08:15:48 +00:00
|
|
|
.PP
|
|
|
|
Note that on many modern systems,
|
|
|
|
.BR systemd (1)
|
|
|
|
automatically mounts the
|
|
|
|
.I cgroup2
|
|
|
|
filesystem at
|
|
|
|
.I /sys/fs/cgroup/unified
|
|
|
|
during the boot process.
|
2016-10-07 17:56:38 +00:00
|
|
|
.\"
|
2017-12-23 08:07:00 +00:00
|
|
|
.SS Cgroups v2 controllers
|
|
|
|
The following controllers, documented in the kernel source file
|
|
|
|
.IR Documentation/cgroup-v2.txt ,
|
|
|
|
are supported in cgroups version 2:
|
|
|
|
.TP
|
|
|
|
.IR io " (since Linux 4.5)"
|
|
|
|
This is the successor of the version 1
|
|
|
|
.I blkio
|
|
|
|
controller.
|
|
|
|
.TP
|
|
|
|
.IR memory " (since Linux 4.5)"
|
|
|
|
This is the successor of the version 1
|
|
|
|
.I memory
|
|
|
|
controller.
|
|
|
|
.TP
|
|
|
|
.IR pids " (since Linux 4.5)"
|
|
|
|
This is the same as the version 1
|
|
|
|
.I pids
|
|
|
|
controller.
|
|
|
|
.TP
|
|
|
|
.IR perf_event " (since Linux 4.11)"
|
|
|
|
This is the same as the the version 1
|
|
|
|
.I perf_event
|
|
|
|
controller.
|
|
|
|
.TP
|
|
|
|
.IR rdma " (since Linux 4.11)"
|
|
|
|
This is the same as the version 1
|
|
|
|
.I rdma
|
|
|
|
controller.
|
|
|
|
.TP
|
|
|
|
.IR cpu " (since Linux 4.15)"
|
|
|
|
This is the successor to the version 1
|
|
|
|
.I cpu
|
|
|
|
and
|
|
|
|
.I cpuacct
|
|
|
|
controllers.
|
|
|
|
.\"
|
2016-10-07 20:33:56 +00:00
|
|
|
.SS Cgroups v2 """no internal processes""" rule
|
2016-10-07 15:02:32 +00:00
|
|
|
With the exception of the root cgroup, processes may reside
|
|
|
|
only in leaf nodes (cgroups that do not themselves contain child cgroups).
|
2016-10-07 11:24:07 +00:00
|
|
|
This avoids the need to decide how to partition resources between
|
|
|
|
processes which are members of cgroup A and processes in child cgroups of A.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-04-24 18:26:50 +00:00
|
|
|
For instance, if cgroup
|
|
|
|
.I /cg1/cg2
|
2016-10-02 14:36:38 +00:00
|
|
|
exists, then a process may reside in
|
2016-04-24 18:26:50 +00:00
|
|
|
.IR /cg1/cg2 ,
|
|
|
|
but not in
|
|
|
|
.IR /cg1 .
|
2016-10-07 14:43:34 +00:00
|
|
|
This is to avoid an ambiguity in cgroups v1
|
2016-10-07 11:28:14 +00:00
|
|
|
with respect to the delegation of resources between processes in
|
2016-04-24 18:26:50 +00:00
|
|
|
.I /cg1
|
|
|
|
and its child cgroups.
|
2016-10-07 11:28:14 +00:00
|
|
|
The recommended approach in cgroups v2 is to create a subdirectory called
|
2016-04-24 18:26:50 +00:00
|
|
|
.I leaf
|
2016-10-07 11:28:14 +00:00
|
|
|
for any nonleaf cgroup which should contain processes, but no child cgroups.
|
|
|
|
Thus, processes which previously would have gone into
|
2016-04-24 18:26:50 +00:00
|
|
|
.I /cg1
|
|
|
|
would now go into
|
|
|
|
.IR /cg1/leaf .
|
2016-10-07 11:28:14 +00:00
|
|
|
This has the advantage of making explicit
|
|
|
|
the relationship between processes in
|
2016-04-24 18:26:50 +00:00
|
|
|
.I /cg1/leaf
|
|
|
|
and
|
|
|
|
.IR /cg1 's
|
|
|
|
other children.
|
2016-10-07 15:02:32 +00:00
|
|
|
.\"
|
|
|
|
.SS Cgroups v2 subtree control
|
2017-12-23 12:03:21 +00:00
|
|
|
Each cgroup in the v2 hierarchy contains the following two files:
|
|
|
|
.TP
|
|
|
|
.IR cgroup.controllers
|
|
|
|
This is a list of the controllers that are
|
|
|
|
.I available
|
|
|
|
in this cgroup.
|
|
|
|
The contents of this file match the contents of the
|
|
|
|
.I cgroup.subtree_control
|
|
|
|
file in the parent cgroup.
|
|
|
|
.TP
|
|
|
|
.I cgroup.subtree_control
|
|
|
|
This is a list of controllers that are
|
|
|
|
.IR active
|
|
|
|
.RI ( enabled )
|
|
|
|
in the cgroup.
|
|
|
|
The set of controllers in this file is a subset of the set in the
|
2016-04-24 18:26:50 +00:00
|
|
|
.IR cgroup.controllers
|
2017-12-23 12:03:21 +00:00
|
|
|
of this cgroup.
|
|
|
|
The set of active controllers is modified by writing strings to this file
|
|
|
|
containing space-delimited controller names,
|
|
|
|
each preceded by '+' (to enable a controller)
|
|
|
|
or '\-' (to disable a controller), as in the following example:
|
|
|
|
.IP
|
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
echo '+pids -memory' > x/y/cgroup.subtree_control
|
|
|
|
.EE
|
|
|
|
.in
|
|
|
|
.IP
|
|
|
|
.PP
|
|
|
|
Because the list of controllers in
|
|
|
|
.I cgroup.subtree_control
|
|
|
|
is a subset of those
|
|
|
|
.IR cgroup.controllers ,
|
|
|
|
a controller that has been disabled in one cgroup in the hierarchy
|
|
|
|
can never be re-enabled in the subtree below that cgroup.
|
|
|
|
.PP
|
|
|
|
A cgroup's
|
|
|
|
.I cgroup.subtree_control
|
|
|
|
file determines the set of controllers that are exercised in the
|
|
|
|
.I child
|
|
|
|
cgroups.
|
|
|
|
When a controller (e.g.,
|
|
|
|
.IR pids )
|
|
|
|
is present in the
|
|
|
|
.I cgroup.subtree_control
|
|
|
|
file of a parent cgroup,
|
|
|
|
then the corresponding controller-interface files (e.g.,
|
|
|
|
.IR pids.max )
|
|
|
|
are automatically created in the children of that cgroup
|
|
|
|
and can be used to exert resource control in the child cgroups.
|
2016-04-24 18:26:50 +00:00
|
|
|
.\"
|
2016-10-07 20:19:46 +00:00
|
|
|
.SS Cgroups v2 cgroup.events file
|
|
|
|
With cgroups v2, a new mechanism is provided to obtain notification
|
|
|
|
about when a cgroup becomes empty.
|
|
|
|
The cgroups v1
|
|
|
|
.IR release_agent
|
|
|
|
and
|
|
|
|
.IR notify_on_release
|
|
|
|
files are removed, and replaced by a new, more general-purpose file,
|
|
|
|
.IR cgroup.events .
|
|
|
|
This file contains key-value pairs
|
|
|
|
(delimited by newline characters, with the key and value separated by spaces)
|
|
|
|
that identify events or state for a cgroup.
|
|
|
|
Currently, only one key appears in this file,
|
|
|
|
.IR populated ,
|
|
|
|
which has either the value 0,
|
|
|
|
meaning that the cgroup (and its descendants)
|
|
|
|
contain no (nonzombie) processes,
|
|
|
|
or 1, meaning that the cgroup contains member processes.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 20:19:46 +00:00
|
|
|
The
|
|
|
|
.IR cgroup.events
|
|
|
|
file can be monitored, in order to receive notification when a cgroup
|
|
|
|
transitions between the populated and unpopulated states (or vice versa).
|
|
|
|
When monitoring this file using
|
|
|
|
.BR inotify (7),
|
|
|
|
transitions generate
|
|
|
|
.BR IN_MODIFY
|
|
|
|
events, and when monitoring the file using
|
|
|
|
.BR poll (2),
|
|
|
|
transitions generate
|
|
|
|
.B POLLPRI
|
|
|
|
events.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-10-07 20:19:46 +00:00
|
|
|
The cgroups v2
|
|
|
|
.IR notify_on_release
|
|
|
|
mechanism offers at least two advantages over the cgroups v1
|
|
|
|
.IR release_agent
|
|
|
|
mechanism.
|
|
|
|
First, it allows for cheaper notification,
|
|
|
|
since a single process can monitor multiple
|
|
|
|
.IR cgroup.events
|
|
|
|
files.
|
|
|
|
By contrast, the cgroups v1 mechanism requires the creation
|
|
|
|
of a process for each notification.
|
2016-10-08 13:58:36 +00:00
|
|
|
Second, notification can be delegated to a process that lives inside
|
2016-10-07 20:19:46 +00:00
|
|
|
a container associated with the newly empty cgroup.
|
2016-10-07 11:01:32 +00:00
|
|
|
.\"
|
2016-04-28 06:10:29 +00:00
|
|
|
.SS /proc files
|
|
|
|
.TP
|
2016-04-28 07:22:52 +00:00
|
|
|
.IR /proc/cgroups " (since Linux 2.6.24)"
|
2016-04-28 18:17:50 +00:00
|
|
|
This file contains information about the controllers
|
2016-10-02 13:49:25 +00:00
|
|
|
that are compiled into the kernel.
|
2016-04-28 07:22:52 +00:00
|
|
|
An example of the contents of this file (reformatted for readability)
|
|
|
|
is the following:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-04-28 07:22:52 +00:00
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2016-10-07 14:05:50 +00:00
|
|
|
#subsys_name hierarchy num_cgroups enabled
|
|
|
|
cpuset 4 1 1
|
|
|
|
cpu 8 1 1
|
|
|
|
cpuacct 8 1 1
|
|
|
|
blkio 6 1 1
|
|
|
|
memory 3 1 1
|
|
|
|
devices 10 84 1
|
|
|
|
freezer 7 1 1
|
|
|
|
net_cls 9 1 1
|
|
|
|
perf_event 5 1 1
|
|
|
|
net_prio 9 1 1
|
|
|
|
hugetlb 0 1 0
|
|
|
|
pids 2 1 1
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
ioctl_console.2, ioctl_getfsmap.2, ioctl_iflags.2, ioctl_list.2, ioctl_ns.2, kcmp.2, kexec_load.2, keyctl.2, link.2, mmap.2, modify_ldt.2, msgctl.2, poll.2, query_module.2, quotactl.2, recv.2, recvmmsg.2, sched_setscheduler.2, seccomp.2, select.2, semctl.2, semop.2, send.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sysinfo.2, timer_create.2, timerfd_create.2, uname.2, unshare.2, userfaultfd.2, ustat.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, backtrace.3, bswap.3, btree.3, clock_getcpuclockid.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, fmemopen.3, fopencookie.3, frexp.3, fts.3, ftw.3, getaddrinfo.3, getaddrinfo_a.3, getcontext.3, getgrouplist.3, getifaddrs.3, getipnodebyname.3, getnameinfo.3, getopt.3, getprotoent_r.3, getpwent_r.3, getrpcent.3, getservent_r.3, getttyent.3, getumask.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, inet.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallopt.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mtrace.3, newlocale.3, ntp_gettime.3, offsetof.3, posix_openpt.3, printf.3, pthread_setname_np.3, pthread_setschedparam.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, sigvec.3, stdarg.3, strcat.3, strcpy.3, strftime.3, strtol.3, toupper.3, ttyslot.3, fuse.4, loop.4, st.4, elf.5, cgroup_namespaces.7, cgroups.7, feature_test_macros.7, inode.7, inotify.7, keyrings.7, man-pages.7, math_error.7, mount_namespaces.7, mq_overview.7, pthreads.7, sched.7, session-keyring.7, udplite.7, unix.7, vdso.7: Use consistent markup for code snippets
The preferred form is
.PP/.IP
.in +4n
.EX
<code>
.EE
.in
.PP/.IP
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:37:55 +00:00
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-04-28 07:22:52 +00:00
|
|
|
The fields in this file are, from left to right:
|
|
|
|
.RS
|
|
|
|
.IP 1. 3
|
|
|
|
The name of the controller.
|
|
|
|
.IP 2.
|
2016-04-28 18:17:50 +00:00
|
|
|
The unique ID of the cgroup hierarchy on which this controller is mounted.
|
2016-04-28 19:01:33 +00:00
|
|
|
If multiple cgroups v1 controllers are bound to the same hierarchy,
|
2016-04-28 07:22:52 +00:00
|
|
|
then each will show the same hierarchy ID in this field.
|
2016-04-28 18:17:50 +00:00
|
|
|
The value in this field will be 0 if:
|
|
|
|
.RS 5
|
|
|
|
.IP a) 3
|
|
|
|
the controller is not mounted on a cgroups v1 hierarchy;
|
|
|
|
.IP b)
|
|
|
|
the controller is bound to the cgroups v2 single unified hierarchy; or
|
|
|
|
.IP c)
|
|
|
|
the controller is disabled (see below).
|
|
|
|
.RE
|
2016-04-28 07:22:52 +00:00
|
|
|
.IP 3.
|
|
|
|
The number of control groups in this hierarchy using this controller.
|
|
|
|
.IP 4.
|
|
|
|
This field contains the value 1 if this controller is enabled,
|
|
|
|
or 0 if it has been disabled (via the
|
|
|
|
.IR cgroup_disable
|
|
|
|
kernel command-line boot parameter).
|
|
|
|
.RE
|
|
|
|
.TP
|
2016-04-28 06:10:29 +00:00
|
|
|
.IR /proc/[pid]/cgroup " (since Linux 2.6.24)"
|
2016-04-28 18:22:06 +00:00
|
|
|
This file describes control groups to which the process
|
|
|
|
with the corresponding PID belongs.
|
2016-04-28 06:24:51 +00:00
|
|
|
The displayed information differs for
|
2016-04-28 19:09:36 +00:00
|
|
|
cgroups version 1 and version 2 hierarchies.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-04-28 06:24:51 +00:00
|
|
|
For each cgroup hierarchy of which the process is a member,
|
2017-12-23 08:09:41 +00:00
|
|
|
there is one entry containing three colon-separated fields:
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2017-12-23 08:09:26 +00:00
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
hierarchy-ID:controller-list:cgroup-path
|
|
|
|
.EE
|
|
|
|
.in
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.IP
|
2016-04-28 06:24:51 +00:00
|
|
|
For example:
|
2017-08-15 14:34:53 +00:00
|
|
|
.IP
|
|
|
|
.in +4n
|
|
|
|
.EX
|
|
|
|
5:cpuacct,cpu,cpuset:/daemons
|
|
|
|
.EE
|
|
|
|
.in
|
2016-04-28 06:10:29 +00:00
|
|
|
.IP
|
|
|
|
The colon-separated fields are, from left to right:
|
2016-04-28 06:24:51 +00:00
|
|
|
.RS
|
2016-04-28 06:10:29 +00:00
|
|
|
.IP 1. 3
|
2016-04-28 06:24:51 +00:00
|
|
|
For cgroups version 1 hierarchies,
|
|
|
|
this field contains a unique hierarchy ID number
|
|
|
|
that can be matched to a hierarchy ID in
|
|
|
|
.IR /proc/cgroups .
|
|
|
|
For the cgroups version 2 hierarchy, this field contains the value 0.
|
2016-04-28 06:10:29 +00:00
|
|
|
.IP 2.
|
2016-04-28 06:24:51 +00:00
|
|
|
For cgroups version 1 hierarchies,
|
2016-10-07 09:46:40 +00:00
|
|
|
this field contains a comma-separated list of the controllers
|
2016-04-28 06:24:51 +00:00
|
|
|
bound to the hierarchy.
|
|
|
|
For the cgroups version 2 hierarchy, this field is empty.
|
2016-04-28 06:10:29 +00:00
|
|
|
.IP 3.
|
2016-04-28 06:24:51 +00:00
|
|
|
This field contains the pathname of the control group in the hierarchy
|
|
|
|
to which the process belongs.
|
|
|
|
This pathname is relative to the mount point of the hierarchy.
|
2016-04-28 06:10:29 +00:00
|
|
|
.RE
|
2016-06-28 04:32:23 +00:00
|
|
|
.SH ERRORS
|
|
|
|
The following errors can occur for
|
|
|
|
.BR mount (2):
|
|
|
|
.TP
|
|
|
|
.B EBUSY
|
|
|
|
An attempt to mount a cgroup version 1 filesystem specified neither the
|
|
|
|
.I name=
|
|
|
|
option (to mount a named hierarchy) nor a controller name (or
|
2016-10-02 14:39:25 +00:00
|
|
|
.IR all ).
|
2016-10-07 11:31:22 +00:00
|
|
|
.SH NOTES
|
|
|
|
A child process created via
|
|
|
|
.BR fork (2)
|
|
|
|
inherits its parent's cgroup memberships.
|
|
|
|
A process's cgroup memberships are preserved across
|
|
|
|
.BR execve (2).
|
2016-04-24 18:52:27 +00:00
|
|
|
.SH SEE ALSO
|
2016-04-25 14:23:56 +00:00
|
|
|
.BR prlimit (1),
|
2016-04-28 07:41:06 +00:00
|
|
|
.BR systemd (1),
|
2017-08-07 10:52:13 +00:00
|
|
|
.BR systemd-cgls (1),
|
|
|
|
.BR systemd-cgtop (1),
|
2016-04-26 12:34:18 +00:00
|
|
|
.BR clone (2),
|
2016-04-25 14:23:56 +00:00
|
|
|
.BR ioprio_set (2),
|
|
|
|
.BR perf_event_open (2),
|
|
|
|
.BR setrlimit (2),
|
2016-05-06 17:48:05 +00:00
|
|
|
.BR cgroup_namespaces (7),
|
2016-04-24 18:57:57 +00:00
|
|
|
.BR cpuset (7),
|
2016-04-25 14:23:56 +00:00
|
|
|
.BR namespaces (7),
|
|
|
|
.BR sched (7),
|
|
|
|
.BR user_namespaces (7)
|