Lines Matching refs:cgroup

14       When we mention a cgroup (cgroupfs's directory) with memory controller,
15 we call it "memory cgroup". When you see git-log and source code, you'll
28 b. Create a cgroup with a limited amount of memory; this can be used
50 - Root cgroup has no limit controls.
58 cgroup.procs # show list of processes
59 cgroup.event_control # an interface for event_fd()
126 processes associated with the controller. Each cgroup has a memory controller
154 1. Accounting happens per cgroup
155 2. Each mm_struct knows about which cgroup it belongs to
157 cgroup it belongs to
160 set up the necessary data structures and check if the cgroup that is being
161 charged is over its limit. If it is, then reclaim is invoked on the cgroup.
164 updated. page_cgroup has its own LRU on cgroup.
196 cgroup that first touches a page is accounted for the page. The principle
197 behind this approach is that a cgroup that aggressively uses a shared
199 the cgroup that brought it in -- this will happen on memory pressure).
201 But see section 8.2: when moving a task to another cgroup, its pages may
202 be recharged to the new cgroup, if move_charge_at_immigrate has been chosen.
234 * What happens when a cgroup hits memory.memsw.limit_in_bytes
235 When a cgroup hits memory.memsw.limit_in_bytes, it's useless to do swap-out
236 in this cgroup. Then, swap-out will not be done by cgroup routine and file
239 it by cgroup.
243 Each cgroup maintains a per cgroup LRU which has the same structure as
244 global VM. When a cgroup goes over its limit, we first try
245 to reclaim memory from the cgroup so as to make space for the new
246 pages that the cgroup has touched. If the reclaim is unsuccessful,
248 cgroup. (See 10. OOM Control below.)
251 pages that are selected for reclaiming come from the per-cgroup LRU
254 NOTE: Reclaim does not work for the root cgroup, since we cannot set any
255 limits on the root cgroup.
273 per-zone-per-cgroup LRU (cgroup's private LRU) is just guarded by
285 cannot be set if the cgroup have children, or if there are already tasks in the
286 cgroup. Attempting to set the limit under those conditions will return -EBUSY.
295 Kernel memory limits are not imposed for the root cgroup. Usage for the root
296 cgroup may or may not be accounted. The memory used is accumulated into
320 per cgroup, instead of globally.
337 deployments where the total amount of memory per-cgroup is overcommited.
344 triggered for a cgroup when it hits K while staying below U, which makes
349 triggered for the cgroup for both kinds of memory. This setup gives the
363 # mount -t tmpfs none /sys/fs/cgroup
364 # mkdir /sys/fs/cgroup/memory
365 # mount -t cgroup none /sys/fs/cgroup/memory -o memory
368 # mkdir /sys/fs/cgroup/memory/0
369 # echo $$ > /sys/fs/cgroup/memory/0/tasks
371 Since now we're in the 0 cgroup, we can alter the memory limit:
372 # echo 4M > /sys/fs/cgroup/memory/0/memory.limit_in_bytes
378 NOTE: We cannot set limits on the root cgroup any more.
380 # cat /sys/fs/cgroup/memory/0/memory.limit_in_bytes
384 # cat /sys/fs/cgroup/memory/0/memory.usage_in_bytes
397 The memory.failcnt field gives the number of times that the cgroup limit was
420 Sometimes a user might find that the application under a cgroup is
423 1. The cgroup limit is too low (just too low to do anything useful)
427 some of the pages cached in the cgroup (page cache pages).
434 When a task migrates from one cgroup to another, its charge is not
435 carried forward by default. The pages allocated from the original cgroup still
442 4.3 Removing a cgroup
444 A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
445 cgroup might have some charge associated with it, even though all
453 Charges recorded in swap information is not updated at removal of cgroup.
454 Recorded information is discarded and a cgroup which uses swap (swapcache)
462 memory.force_empty interface is provided to make cgroup's memory usage empty.
467 the cgroup will be reclaimed and as many pages reclaimed as possible.
484 # per-memory cgroup local status
490 pgpgin - # of charging events to the memory cgroup. The charging
492 anon page(RSS) or cache page(Page Cache) to the cgroup.
493 pgpgout - # of uncharging events to the memory cgroup. The uncharging
494 event happens each time a page is unaccounted from the cgroup.
510 under which the memory cgroup is
512 hierarchy under which memory cgroup is.
515 addition to the cgroup's own value includes the
534 amount of physical memory used by the cgroup.
535 'rss + file_mapped" will give you resident set size of cgroup.
537 file_mapped is accounted only when the memory cgroup is owner of page
543 in the root cgroup corresponds to the global swappiness setting.
552 A memory cgroup provides memory.failcnt and memory.memsw.failcnt files.
554 hit its limit. When a memory cgroup hits a limit, failcnt increases and
562 For efficiency, as other kernel components, memory cgroup uses some optimization
595 cgroup filesystem. Consider for example, the following cgroup filesystem
614 A memory cgroup by default disables the hierarchy feature. Support
615 can be enabled by writing 1 to memory.use_hierarchy file of the root cgroup
623 NOTE1: Enabling/disabling will fail if either the cgroup already has other
624 cgroups created below it, or if the parent cgroup has use_hierarchy
628 case of an OOM event in any cgroup.
668 is, uncharge task's pages from the old cgroup and charge them to the new cgroup.
675 writing to memory.move_charge_at_immigrate of the destination cgroup.
685 Note: If we cannot find enough space for the task in the destination cgroup, we
699 (old) memory cgroup.
722 Memory cgroup implements memory thresholds using the cgroups notification
730 cgroup.event_control.
735 It's applicable for root and non-root cgroup.
741 Memory cgroup implements OOM notifier using the cgroup notification
749 cgroup.event_control
752 OOM notification doesn't work for the root cgroup.
758 If OOM-killer is disabled, tasks under cgroup will hang/sleep
759 in memory cgroup's OOM-waitqueue when they request accountable memory.
761 For running them, you have to relax the memory cgroup's OOM status by
772 under_oom 0 or 1 (if 1, the memory cgroup is under OOM, tasks may
817 to cgroup.event_control.
825 Here is a small script example that makes a new cgroup, sets up a
826 memory limit, sets up a notification in the cgroup and then makes child
827 cgroup experience a critical pressure:
829 # cd /sys/fs/cgroup/memory/
843 1. Make per-cgroup scanner reclaim not-shared pages first