Ku bood nuxurka
Korur

cgroup v2 memory accounting and the OOM killer

How Linux charges, throttles and kills inside a memory cgroup, traced through kernel v7.2 source and a lab, and what the kubelet adds in Kubernetes 1.37.

A Kubernetes memory limit ends up as a number in one file, memory.max, in one directory of the cgroup v2 hierarchy. Everything that follows, the reclaim, the throttling, the OOMKilled status, the eviction that arrives a housekeeping interval too late, comes from how the kernel's memory controller counts pages and what it does when a count crosses a line. Most memory surprises on Kubernetes nodes stop being surprising once you have read that code, because the code is short, well commented, and does exactly what it says.

This article follows a page from the fault that allocates it to the counter that charges it, through the four files that bound the counter, to the two independent killers that act when the bounds are not enough: the kernel OOM killer and the kubelet eviction manager. Kernel references are pinned to Linux v7.2. The lab ran on Fedora 43 with kernel 7.2.13, and every number in the text that is not quoted from a source comes from that lab. Kubernetes status is as of v1.37.2, the current stable release on the day of writing.

The charge path: one counter per cgroup

Each memory cgroup is a struct mem_cgroup, and the value memory.current prints is the usage field of the struct page_counter embedded in it as memory1. The same struct carries min, low, high and max, the effective protections emin and elow, the watermarks that back memory.peak, and a parent pointer. usage is padded onto its own cache line, with a comment calling it a hot member, because every charge in the system touches it. The counter is kept in pages. The interface files convert on the way in and out, which is why the documentation warns that a value not aligned to the page size may read back rounded up2.

Charges come from a small number of call sites. An ordinary anonymous page fault is charged in folio_prealloc() in mm/memory.c, which allocates an order-0 folio and calls mem_cgroup_charge() on it before the fault maps it. alloc_anon_folio() charges directly only when it allocates a multi-size THP (mTHP) folio; when no larger order is allowed, or every larger order fails to allocate or to charge, it falls back to folio_prealloc()3. A page cache insertion goes through filemap_add_folio() in mm/filemap.c, which charges the folio with mem_cgroup_charge(), then inserts it into the mapping through __filemap_add_folio(), and uncharges it again if the insertion fails4. A tmpfs page is charged in mm/shmem.c right after the folio is marked swap-backed5. All of these end in charge_memcg() and then try_charge_memcg() in mm/memcontrol.c6. When the charge succeeds, commit_charge() records the owner in folio->memcg_data. In v7.2 that field holds an obj_cgroup pointer, an indirection object, rather than the mem_cgroup itself.

The fast path in try_charge_memcg() does not touch the shared counter at all. consume_stock() looks in a per-CPU struct memcg_stock_pcp, which caches pre-charged pages for up to NR_MEMCG_STOCK (7) cgroups per CPU, and takes the pages from there if enough remain6. When the stock runs dry, the function charges a whole batch of MEMCG_CHARGE_BATCH pages, defined as 64 in include/linux/memcontrol.h7, which is 256 KiB with 4 KiB pages, and puts what the current allocation did not need back into the stock. The visible consequence is that a cgroup's counter can run slightly ahead of the memory its tasks have actually touched, by pages parked in per-CPU stocks. That is why the slow path calls drain_all_stock() before it concludes that a cgroup is really out of room.

The slow path is page_counter_try_charge() in mm/page_counter.c8. It walks from the cgroup towards the root along parent, adds the pages at each level with atomic_long_add_return(), and compares the result with that level's max. At the first level that would go over, it subtracts the pages again, records that level in *fail, and unwinds the levels it already charged. There is no lock and no compare-and-swap; the comment in the function accepts that a large speculative charge can briefly crowd out a smaller concurrent one, because the error is bounded by the size difference.

The hierarchical charge loop. Every ancestor is charged, and the first one over its limit is reported back.c
/* mm/page_counter.c, page_counter_try_charge(), Linux v7.2 (abridged) */
for (c = counter; c; c = c->parent) {
	long new;

	new = atomic_long_add_return(nr_pages, &c->usage);
	if (new > c->max) {
		atomic_long_sub(nr_pages, &c->usage);
		*fail = c;          /* the ancestor that is over its limit */
		goto failed;
	}
	if (protection)
		propagate_protected_usage(c, new);
	/* local_watermark and watermark feed memory.peak */
}
return true;

failed:
for (c = counter; c != *fail; c = c->parent)
	page_counter_cancel(c, nr_pages);
return false;

The reported counter is the important part. It tells try_charge_memcg() which cgroup is over its limit, and reclaim and the OOM killer then act on that cgroup, which may be an ancestor of the one that allocated. With container limits alone, Kubernetes rarely produces that case at the pod level. The kubelet's ResourceConfigForPod() sets a memory limit on the pod cgroup only when every container declares one, and it computes that limit with PodLimits(), which returns the sum of the container limits plus spec.overhead when a RuntimeClass sets one910. One charge sits outside that arithmetic: the pod sandbox process the runtime starts under the pod cgroup is charged hierarchically to the pod counter but counted in no container limit. Without an overhead, containers that all sit just below their limits plus the sandbox's pages can push the pod cgroup to memory.max, and then the pod is the level reported in *fail. Apart from that margin, the pod limit covers every container limit, so in practice a container reaches its own limit first.

Pod-level resources change that. With the PodLevelResources feature, beta and enabled by default since 1.3411, a memory limit in the pod's own spec.resources takes precedence over the container limits. The documentation's example pairs a 200 MiB pod limit with one container limited to 100 MiB and a second container with no limit at all12. When the second container drives the pod to 200 MiB, the pod cgroup is the level reported in *fail. The OOM killer then chooses among every task in the pod, which can include a process in the container that stayed under its own 100 MiB. With a memoryThrottlingFactor configured and Memory QoS enforced, the pod-level limit also gives the pod cgroup its own memory.high, so every container in the pod is throttled together once the pod's combined charge crosses it, before the pod cgroup reaches memory.max13. Outside that case the general kernel rule still applies: the OOM domain is whichever ancestor is reported in *fail, not necessarily the cgroup whose task asked for the page.

Four knobs, two directions

cgroup v2 gives the memory controller two upper bounds and two protections. memory.max and memory.high cap a cgroup from above; memory.min and memory.low shield it from reclaim from below2. They are enforced in different parts of the kernel, at different moments and with different consequences. Treating one as a substitute for another is the quickest way to configure a node that behaves nothing like its YAML suggests.

Where each memory knob is enforced in Linux v7.2 and what it costs when it is crossed.
KnobDirectionEnforced inWhen crossedmemory.events key
memory.maxUpper, hardtry_charge_memcg() on every charge that misses the stockSynchronous reclaim, then the cgroup OOM killermax, oom, oom_kill
memory.highUpper, soft__mem_cgroup_handle_over_high() on return to user modeReclaim, then a sleep of up to 2 s per return; never the OOM killerhigh
memory.lowLower, best effortClassic LRU and cgroup limit reclaim: shrink_node_memcgs(); node reclaim under MGLRU: shrink_one()Against reclaim aimed at an ancestor or the node. Classic: skipped while unprotected memory exists elsewhere. MGLRU: skipped on the first attempt, reclaimed on the next. Ignored when the cgroup itself is the reclaim target (mem_cgroup_unprotected())low
memory.minLower, hardClassic LRU and cgroup limit reclaim: shrink_node_memcgs(); node reclaim under MGLRU: shrink_one()Not reclaimed by reclaim aimed at an ancestor or the node; OOM if nothing else is reclaimable. Ignored when the cgroup's own memory.max or memory.high triggers the reclaim (mem_cgroup_unprotected())none

memory.max: reclaim, retry, kill

When the batch charge fails, try_charge_memcg() first retries with exactly the pages it needs instead of a full batch. If that also fails, it raises the max event on the cgroup that is over its limit and calls try_to_free_mem_cgroup_pages() on it, wrapped in psi_memstall_enter() and psi_memstall_leave() so the time spent reclaiming is accounted as memory pressure6. It drains the per-CPU stocks once, retries as long as reclaim frees pages, and tolerates MAX_RECLAIM_RETRIES attempts without progress, a constant defined as 16 in mm/internal.h14. Only then does it call mem_cgroup_oom().

Three details in this path explain behaviour that otherwise looks inconsistent. First, mem_cgroup_oom() refuses to kill for charges above PAGE_ALLOC_COSTLY_ORDER, so a large high-order charge fails with -ENOMEM instead; the documentation says the same in prose when it notes that some allocations do not invoke the OOM killer and may return -ENOMEM to user space2. Second, an allocation that carries __GFP_NOFAIL or __GFP_HIGH is force-charged past the limit with page_counter_charge(), which is what the documentation means by usage going over the limit temporarily. Third, mem_cgroup_out_of_memory() takes the global oom_lock and checks mem_cgroup_margin() again before choosing a victim, so a concurrent free that makes room cancels the kill6.

Lowering memory.max on a live cgroup takes the same road from the other end. memory_max_write() swaps in the new limit with xchg() and then loops: drain the stocks, reclaim, give up after 16 attempts without progress, raise an oom event and call the OOM killer while usage stays above the new limit6. Shrinking a running container below what it holds is therefore a kill order, not a hint. The one exception is a writer that opens the file with O_NONBLOCK, for which the kernel skips the synchronous reclaim and OOM and leaves both to the cgroup's next charge2.

memory.high: a debt paid on the way back to user space

memory.high is not a limit on the charge path. After a charge succeeds, try_charge_memcg() walks up the hierarchy, and if any level sits above its high value it adds the batch to current->memcg_nr_pages_over_high and calls set_notify_resume()6. The task keeps its pages. The bill is collected when the task next returns to user mode: resume_user_mode_work() in include/linux/resume_user_mode.h calls mem_cgroup_handle_over_high()15, which runs __mem_cgroup_handle_over_high() if the task owes pages. When the debt grows beyond one batch and the allocation context may block, the charge path also calls the handler synchronously so a task cannot run up a large overage inside a single system call.

The handler reclaims first. If the cgroup is still above high, it calls calculate_high_delay(). The overage is (usage - high) / high in fixed point with 20 bits of extra precision; the penalty is that ratio squared, multiplied by HZ, shifted down by the precision bits and a further 14 scaling bits, and then scaled by the pages this task charged relative to the 64-page batch6. The result is capped at MEMCG_MAX_HIGH_DELAY_JIFFIES, two seconds, and dropped entirely if it comes to 10 ms or less. The source carries a worked table for a 100 MiB high: 6 ms at 101M, 102 ms at 104M, 639 ms at 110M, and the two-second cap from 118M. The task then sleeps in schedule_timeout_killable(), inside another memstall, so the sleep is counted as memory pressure.

The quadratic throttle. A 10 percent overage is already measured in hundreds of milliseconds per return to user mode.c
/* mm/memcontrol.c, Linux v7.2 (abridged) */
#define MEMCG_MAX_HIGH_DELAY_JIFFIES (2UL*HZ)
#define MEMCG_DELAY_PRECISION_SHIFT 20
#define MEMCG_DELAY_SCALING_SHIFT 14

static u64 calculate_overage(unsigned long usage, unsigned long high)
{
	u64 overage;

	if (usage <= high)
		return 0;
	high = max(high, 1UL);
	overage = usage - high;
	overage <<= MEMCG_DELAY_PRECISION_SHIFT;
	return div64_u64(overage, high);
}

static unsigned long calculate_high_delay(struct mem_cgroup *memcg,
					  unsigned int nr_pages,
					  u64 max_overage)
{
	unsigned long penalty_jiffies;

	if (!max_overage)
		return 0;
	penalty_jiffies = max_overage * max_overage * HZ;
	penalty_jiffies >>= MEMCG_DELAY_PRECISION_SHIFT;
	penalty_jiffies >>= MEMCG_DELAY_SCALING_SHIFT;
	return penalty_jiffies * nr_pages / MEMCG_CHARGE_BATCH;
}

The retry before sleeping has a history that matters for Kubernetes, and the Kubernetes account of it says more than the kernel commit does. Commit b3ff92916af3, "mm, memcg: reclaim more aggressively before high allocator throttling", addressed cgroups at Facebook that sat in allocator throttling while holding gigabytes of trivially reclaimable page cache, because the handler tried only one reclaim walk per return to user mode before it computed a penalty16. The commit makes the handler retry reclaim until the task is under the 10 ms grace period or reclaim makes no progress at all, and its message is explicit about the second case: "we enter reclaim throttling as before". In v7.2 that is the if (nr_reclaimed || nr_retries--) test in __mem_cgroup_handle_over_high(). Any progress restarts reclaim; after MAX_RECLAIM_RETRIES further attempts without progress the task sleeps for the computed penalty, and nothing limits how many times a task can go through that sequence6.

KEP-2570 presents the same commit, shipped in kernel 5.9, as the fix for the livelock that cancelled the Memory QoS beta in Kubernetes 1.28, and states that kernels from 5.9 on contain a fix that prevents indefinite throttling at memory.high17. That is the KEP's claim, and it overstates the commit. The commit fixes throttling of cgroups that still hold reclaimable memory such as page cache. A workload whose growth is anonymous memory with no swap gives reclaim nothing to free, so on current kernels it still stalls at memory.high and never reaches memory.max, where the OOM killer would at least end it. Lab run 2 shows exactly that on 7.2.13: the allocator was held at memory.high for the full 90 seconds, single 4 MiB steps took up to 32,864 ms, and the kernel never killed it. A repeat of the run, 2b, produced steps of 7,008, 20,312 and 15,976 ms. Treat a 5.9 kernel as the end of one failure mode, not as a guarantee of forward progress.

The kernel documentation is candid about the intended use. It calls memory.high the main mechanism for controlling memory usage, states that crossing it never invokes the OOM killer, and says it is meant for setups where an external process monitors the throttled cgroup2. That last clause is the one people skip. A throttled process with nobody watching does not fail. It slows down while holding its locks, its connections and its place behind a load balancer, and often passes a liveness probe just well enough to keep receiving traffic. In the lab, a single Python process spent just over 50 seconds of a 90-second run asleep in this path and was never killed.

memory.low and memory.min: protection lives in the reclaimer

Protection is not checked when memory is charged; it is checked when memory is taken away, and in v7.2 there are two reclaimers that check it. On the classic active and inactive LRU, shrink_node_memcgs() in mm/vmscan.c iterates the cgroups under the reclaim target and calls mem_cgroup_calculate_protection() on each one18. A cgroup below its effective min is skipped outright, and the comment next to that continue states the consequence: if there is no reclaimable memory elsewhere, the result is an OOM. A cgroup below its effective low is skipped on the first pass and the scan control records memcg_low_skipped; if that pass fails to reclaim enough, a second pass with memcg_low_reclaim set reclaims from it anyway and raises its low event. Above the protected amount, apply_proportional_protection() scales scan pressure by the share of usage that is protected, so protection fades out gradually instead of switching off at a threshold.

Protection is also relative to the reclaim target, and the target's own protection does not count. mem_cgroup_below_min() and mem_cgroup_below_low() in include/linux/memcontrol.h return false whenever mem_cgroup_unprotected() returns true, and that helper returns true for the root cgroup and for memcg == target; its comment reads "The target memcg's protection is ignored"7. page_counter_calculate_protection() skips the target for the same reason, and gives each direct child of the target its configured min and low unchanged8. The documentation's "Reclaim Protection" section states the rule: protection applies relative to the target of the reclaim, whether that is a cgroup limit, proactive memory.reclaim or global reclaim2. A cgroup's memory.min therefore shields it from reclaim aimed at an ancestor or at the whole node, never from the reclaim that its own memory.max or memory.high triggers. A cgroup whose min equals its max still loses page cache to reclaim when it reaches its own limit. When an ancestor is the target, the picture reverses: a child below its effective min is skipped outright, and if every child is protected, the ancestor's limit reclaim finds nothing to take and ends in the OOM killer.

The multi-gen LRU (MGLRU) takes a different road for node-level reclaim. When it is enabled, shrink_node() hands kswapd and global direct reclaim to lru_gen_shrink_node(), which calls shrink_many(). That function walks a per-node LRU of memory cgroups, not the cgroup tree, and shrink_one() applies protection to each entry18. A cgroup below its effective min is not reclaimed and is rotated to the young generation of that LRU (MEMCG_LRU_YOUNG). A cgroup below its effective low is not reclaimed on the first attempt; it is moved to the tail of a random bin in its current memcg generation (MEMCG_LRU_TAIL). On the next attempt its segment is already the tail, so it is reclaimed and its low event is raised1819. Nothing in this path asks whether unprotected memory exists elsewhere. Under MGLRU, memory.low postpones the reclaim of a protected cgroup by one round rather than sparing it while other cgroups can pay, and apply_proportional_protection() still scales the scan inside the lruvec. Reclaim aimed at a non-root cgroup, which is what memory.max and memory.high trigger, does not use this path: shrink_node() sends it to shrink_node_memcgs() with the two-pass low logic above, and MGLRU only scans each lruvec, in lru_gen_shrink_lruvec(). A comment in include/linux/mmzone.h says the same: the memcg LRU applies only to global reclaim19.

Which path a node runs is a kernel build and runtime choice. The lab host has CONFIG_LRU_GEN_ENABLED=y, and /sys/kernel/mm/lru_gen/enabled reads 0x0007, the main switch plus both page table components20, so node pressure there takes the MGLRU path. AKS offers several Linux node images21. Ubuntu is the default OS, and node pools on the default Ubuntu OS SKU move to Ubuntu 24.04 when they upgrade to Kubernetes 1.35 or later. Ubuntu 22.04 remains supported until June 30, 2027 and Ubuntu 20.04 until March 17, 2027, Ubuntu 26.04 images are listed, and the FIPS variant is not yet supported on Ubuntu 24.04 and later, so FIPS node pools still run an older Ubuntu release. Azure Linux 3.0 is the other main image, alongside Azure Linux with OS Guard, Flatcar Container Linux and Azure Container Linux. For Ubuntu 24.04 and Azure Linux 3.0 node pools the configuration is pinned: the Ubuntu 24.04 kernel annotations enable MGLRU by default on every architecture, the linux-azure flavour includes those annotations without overriding them, and the Azure Linux 3.0 kernel config also sets CONFIG_LRU_GEN_ENABLED=y222324. Node pools on those two images take the MGLRU path under node pressure. We did not check the kernel configuration of the 20.04, 22.04 or 26.04 images, the FIPS variants, or the other image families, and we did not read the sysfs file on an AKS node for this article. On any node, that file is the authority, and the memory.low semantics you get follow from it.

Effective protection is where configurations quietly stop working, but only against reclaim aimed above the parent. A child's protection is capped by what its ancestors grant, and when siblings together claim more than the parent offers, each receives a share proportional to its actual usage below its own setting2. That cap applies between the reclaim target and the cgroup, not above the target: page_counter_calculate_protection() gives a direct child of the target its configured min and low unchanged and caps only the levels below it8. A generous memory.min on a container therefore counts for nothing against node-level reclaim, or reclaim aimed at kubepods or a QoS cgroup, when the pod and QoS cgroups between that target and the container carry zero. It still protects the container in full when the container's own pod cgroup is the reclaim target. KEP-2570 relies on the first half and leaves out the second. Its rollback resets memory.min and memory.low on the kubepods root cgroup, and memory.low on the Burstable QoS cgroup, to 0 at kubelet startup, and it states that the pod and container values left behind are neutralised because, in its words, "parent=0 wins"17. Checked against the kernel, that holds for node-level reclaim, which targets the root and caps everything below kubepods at zero. When kubepods itself is the target, it holds for Burstable pods, which sit below the reset Burstable QoS cgroup, but not for Guaranteed pods: the kubelet places those directly under kubepods25, so each is a direct child of the target and keeps its stale memory.min. When a pod cgroup is the target, it does not hold at all: the stale container values apply unchanged, still shield the containers from the pod limit's reclaim, and can still lead to the pod-level OOM described in the Memory QoS section below. Stale values last as long as the cgroups that hold them.

Page cache, tmpfs and who owns a page

The memory controller counts more than heap. The documentation lists the tracked usage as user memory, meaning page cache and anonymous memory, plus kernel data structures such as dentries and inodes, and TCP socket buffers2. A page is charged to the cgroup that instantiated it and stays charged there until it is released. Migrating a process to another cgroup does not move what it already charged, and when several cgroups use the same page the documentation calls the choice of owner in-deterministic, adding that over time the page tends to land in a cgroup with enough allowance to avoid high reclaim pressure.

For a container that writes ordinary files this is mostly harmless, because clean file pages can be dropped. In the lab, dd wrote 1 GiB through a cgroup whose memory.max was 128 MiB and exited with status 0 in each of six repeats. Per run, the max event fired between 3,566 and 3,599 times as the limit was hit and reclaim ran, pgsteal recorded between 229,888 and 230,080 pages reclaimed, and the OOM killer was never called. Usage finished between 133,787,648 and 134,209,536 bytes against a limit of 134,217,728, and between 131,334,144 and 132,120,576 bytes of that was page cache. A container that streams to disk reports usage at its limit and is perfectly healthy, which is the first reason usage alone is a poor alarm.

tmpfs is different, and the difference is easy to miss. A tmpfs page is file data in the accounting, so it appears under file in memory.stat, but it is also counted under shmem, which the documentation defines as cached filesystem data that is swap-backed2. Being swap-backed, it lives on the anonymous LRU lists, and without swap it cannot be reclaimed at all. Kubernetes mounts an emptyDir with medium: Memory as tmpfs, and files written there count against the memory limit of the container that wrote them26. Without a sizeLimit such a volume may grow to the pod's memory limit27.

The lab result for tmpfs deserves a slow read. Writing 256 MiB into a tmpfs file inside a 128 MiB cgroup triggered the cgroup OOM killer with 131,940,352 bytes of shmem, all of it on active_anon, and inactive_file at 0. The first victim was not dd. It was the parent bash, because oom_badness() scores a task by its resident set, swap entries and page tables28, and pages written into a tmpfs file through write() are in nobody's resident set. The kernel's task dump showed bash with 964 resident pages and dd with 823, so bash died first and dd second. When both were gone, the 126 MiB file was still sitting on the tmpfs, because nothing in the OOM path deletes files.

Map that onto a pod. Data in an emptyDir is safe across container crashes by design26, so a container killed for filling a memory-backed volume restarts with the volume still full and its cgroup already near the limit. The OOM killer picks whichever process happens to have the largest resident set, which may be a sidecar or the shell in a debug session rather than the writer. The fix is not a larger limit. It is a sizeLimit on every memory-backed emptyDir, so the volume fills up with ENOSPC before the cgroup fills up with an OOM.

Reading memory.events and PSI

memory.events is the controller's own log, and each key is raised by a function already named here. max comes from try_charge_memcg() when a charge hits the limit, high from reclaim_high() for every level found above its high, oom from mem_cgroup_oom() and from memory_max_write(), oom_kill from the kill itself, and oom_group_kill from oom_kill_process() when a group kill happens628. The fields are hierarchical, so a parent's file includes everything below it; memory.events.local holds only the cgroup's own events. A change in either file generates a file-modified event, so a monitor can wait on it instead of polling2.

Read the keys against each other. max climbing while oom stays flat is a cgroup living at its limit on reclaimable memory, like the page cache run. max and oom rising together is a cgroup with nothing left to reclaim. high rising is throttling, and it says nothing about how much time was lost. In the lab, the anonymous allocator at memory.max produced 38 max events before its single oom; each dd run produced about 3,600 and none.

Pressure stall information answers the question the counters cannot: how much time tasks lost waiting for memory. The kernel counts a task as stalled between psi_memstall_enter() and psi_memstall_leave(), and the memory controller wraps its limit reclaim, its high reclaim and its throttle sleep in exactly those calls6. memory.pressure in each cgroup has the format of /proc/pressure/memory: a some line for the share of time in which at least one task was stalled, a full line for the share in which all non-idle tasks were stalled at once, each with 10, 60 and 300 second averages and a cumulative total in microseconds29.

The two upper bounds look nothing alike through this lens. The allocator that hit memory.max accumulated a total of 257 microseconds of stall before it was killed, because anonymous memory without swap gives reclaim nothing to do. The allocator that hit memory.high accumulated 50,090,361 microseconds, with some and full both at 75.87 on the ten-second average, and it was still alive when timeout ended it. One bound fails fast and loudly. The other fails slowly, and only this file says so.

PSI also supports triggers. Writing some 150000 1000000 to a pressure file and polling it for POLLPRI wakes the reader when partial stall exceeds 150 ms within any one-second window; windows run from 500 ms to 10 s, and unprivileged users must use multiples of 2 s29. Kubernetes exposes the same data. The KubeletPSI feature is stable and locked on since 1.36, and the kubelet publishes node, pod and container PSI through the Summary API and its /metrics/cadvisor endpoint30. It does not evict on it: the eviction signals are still memory.available and its filesystem and PID siblings31. Turning pressure into action is left to whoever reads the metric.

Working set is a heuristic, not a measurement

The kubelet does not read memory.current and stop. Its eviction signal is memory.available, defined as node memory capacity minus the node's working set, and on Linux the working set excludes inactive_file on the assumption that inactive page cache is reclaimable under pressure31. The Kubernetes project publishes a script that reproduces the calculation against /sys/fs/cgroup/kubepods.slice: working set is memory.current minus the inactive_file line of memory.stat, floored at zero32.

Apply it to the page cache run, and the answer depends on when you read the file. On an MGLRU kernel, active_file and inactive_file in memory.stat are still the classic NR_ACTIVE_FILE and NR_INACTIVE_FILE counters, but nothing sits on an active or inactive list. They are kept for compatibility with the old ABI: a folio counts as active while its generation is one of the two youngest, max_seq and max_seq - 1, and as inactive otherwise, which is the test in lru_gen_is_active() in include/linux/mm_inline.h3319. Each time aging advances max_seq, inc_max_seq() moves the page count of a whole generation from the active counter to the inactive one in a single step18. The split therefore records how the last aging pass fell relative to the writes, not how often the pages were used.

The six repeats of run 3 show the effect. Usage and page cache were nearly identical every time, as listed above, but active_file ranged from 3,670,016 to 67,633,152 bytes and inactive_file from 63,963,136 to 127,926,272. The kubelet formula puts the working set of the same workload anywhere from 6,008,832 bytes, about 6 MiB, to 69,824,512 bytes, about 67 MiB, for a cgroup that sat at its 128 MiB limit in every run. The conclusion does not rest on any one of those samples. Whatever the split, every byte counted as active_file here is clean page cache of the kind reclaim dropped under this limit, about 230,000 pages per run by pgsteal, and the eviction documentation states that the kubelet treats active_file as not reclaimable and suggests setting the memory request equal to the limit for containers with heavy I/O31. For an I/O-heavy container, then, the working set overstates what the kernel cannot reclaim, and on an MGLRU kernel the size of the overstatement depends on the timing of aging. The tmpfs run is the opposite case and the formula gets it right: shmem sits on the anonymous lists, inactive_file was 0, and the whole 126 MiB counts.

Our rule is to treat working set as an eviction input and nothing more. For sizing a limit, memory.peak is more honest, since it records the highest usage since creation and can be reset per file descriptor by writing to it2, and memory.pressure tells you whether operating near that peak cost the workload any time. A limit chosen from a dashboard of working set averages is a limit chosen from a number that excludes part of what the kernel will charge.

Who the OOM killer picks, and why

A cgroup OOM enters the same out_of_memory() as a system OOM, with oc->memcg set. constrained_alloc() then returns CONSTRAINT_MEMCG and sets oc->totalpages from mem_cgroup_get_max(), which is memory.max plus whatever swap the cgroup may use, and select_bad_process() evaluates only the tasks inside the cgroup through mem_cgroup_scan_tasks()28. Each candidate is scored by oom_badness().

The score is deliberately simple. Points are the task's resident pages, plus its swap entries, plus its page table bytes divided by the page size. Then oom_score_adj is multiplied by totalpages / 1000 and added. A task with oom_score_adj of -1000, one already reaped, or one in the middle of vfork() returns LONG_MIN and is never chosen28. Because totalpages is the cgroup's limit in a memcg OOM, an adjustment is a fraction of the container's limit there and a fraction of node memory in a system OOM. Inside a single container all processes usually share one adjustment, so resident set size decides, which is exactly why the tmpfs writer survived its shell.

Across pods, the adjustment the kubelet writes decides. The values below are from the node-pressure eviction documentation31. With the Burstable formula, a container requesting 4 GiB on a node with 64 GiB of memory gets 1000 minus 62, or 938, almost the same as a BestEffort container, so a modest request buys little protection in a node-level OOM.

oom_score_adj set by the kubelet per pod QoS class.
QoS classoom_score_adj
Guaranteed-997
BestEffort1000
Burstablemin(max(2, 1000 - (1000 × memoryRequestBytes) / machineMemoryCapacityBytes), 999)
Any pod with system-node-critical priority-997

After the victim is chosen, oom_kill_process() asks mem_cgroup_get_oom_group() whether to kill more. That function walks from the victim's cgroup up to the cgroup that ran out, and returns the highest one with memory.oom.group set; every killable task in it is then killed and oom_group_kill is raised628. The documentation describes the setting as treating the cgroup as an indivisible workload, with tasks at oom_score_adj -1000 exempt2. On cgroup v2 the kubelet sets memory.oom.group on container cgroups unless singleProcessOOMKill is true, and the default on cgroup v2 is false34. systemd does the same for a unit with OOMPolicy=kill35. Lab run 5 sets the file directly and fills the cgroup, and the kernel log shows the semantics:

Kernel log of the group kill in lab run 5, trimmed. The allocator is chosen, then every task in the cgroup is killed.text
python3 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=200
oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=/,mems_allowed=0,oom_memcg=/user.slice/user-1000.slice/[email protected]/app.slice/lab-group.scope,...
Memory cgroup out of memory: Killed process 351333 (python3) total-vm:499588kB, anon-rss:260872kB, file-rss:6624kB, shmem-rss:0kB, UID:1000 pgtables:592kB oom_score_adj:200
Tasks in /user.slice/user-1000.slice/[email protected]/app.slice/lab-group.scope are going to be killed due to memory.oom.group set
Memory cgroup out of memory: Killed process 351325 (bash) total-vm:232024kB, anon-rss:312kB, file-rss:3560kB, shmem-rss:0kB, UID:1000 pgtables:72kB oom_score_adj:200
Memory cgroup out of memory: Killed process 351331 (sleep) total-vm:230352kB, anon-rss:112kB, file-rss:2292kB, shmem-rss:0kB, UID:1000 pgtables:60kB oom_score_adj:200
Memory cgroup out of memory: Killed process 351333 (python3) total-vm:499588kB, anon-rss:260872kB, file-rss:6624kB, shmem-rss:0kB, UID:1000 pgtables:592kB oom_score_adj:200

We think the kubelet's default is right. A container with one of its worker processes silently gone is harder to detect and reason about than a container that restarts, and the restart is what OOMKilled and a restart count already report. The setting is node-wide, though, so a workload that genuinely supervises its own children and expects to survive a child's OOM needs a node pool configured for it rather than a pod-level escape hatch.

Kubelet eviction is a different control loop

The kernel acts inside the allocation that crossed the limit. The kubelet acts on a timer. It evaluates eviction thresholds every housekeeping-interval, 10 seconds by default, against stats it polls from cAdvisor, and the default hard threshold on Linux is memory.available<100Mi31. The documentation is explicit that memory growing fast within that window will reach the OOM killer before the kubelet sees MemoryPressure. The kubelet configuration offers kernelMemcgNotification, default false, to have memory thresholds signalled by the kernel instead of polled34. On cgroup v2 it does nothing. NewCgroupNotifier() in pkg/kubelet/eviction/threshold_notifier_linux.go returns a disabledThresholdNotifier, whose Start() and Stop() are empty, whenever the node runs the unified hierarchy. The comment above that check explains that cgroup v2 does not support threshold monitoring through cgroup.event_control and links kubernetes/kubernetes#10633136. On every node this article is about, memory eviction is therefore polled at housekeeping-interval and nothing else.

The two killers also differ in what they leave behind. Eviction sets the pod phase to Failed and terminates the whole pod, and the kubelet ranks candidates by whether usage exceeds requests, then by priority, then by usage relative to requests. An OOM kill ends a container, which the kubelet may restart according to its restartPolicy31. Eviction is the graceful path, and it only works for growth slow enough to be seen at a 10-second cadence with the headroom you configured. Everything faster belongs to the kernel, which is why the node's kubeReserved and systemReserved matter more than the eviction threshold for keeping the kubelet and the container runtime alive during a burst.

Memory QoS in 1.37: on by default, inert by default

KEP-2570 maps pod resources onto the cgroup v2 knobs. Limits go to memory.max, as before. Requests go to memory.min for Guaranteed pods and memory.low for Burstable pods. The KEP's design note places memory.high on container cgroups only, never on the pod cgroup, so that one container's spike cannot throttle its neighbours, and sets none for Guaranteed containers17. The v1.37.2 kubelet keeps that design for pods without pod-level resources. A pod with PodLevelResources enabled and spec.resources.limits.memory set is different. When the kubelet creates the pod cgroup with Memory QoS enforced and a throttling factor configured, podContainerManagerImpl.EnsureExists() calls ApplyPodLevelMemoryHigh(), which writes memory.high on the pod cgroup with the same formula applied to the pod's requests and limits, and writes nothing when the pod's memory request equals its limit913. A container in such a pod with no memory limit of its own gets no container memory.high at all: the kubelet sets skipContainerMemoryHigh because, in the words of its comment, the pod cgroup's memory.high handles throttling hierarchically37. Since the kernel charges every ancestor on the way up, the pod cgroup then becomes a shared throttling domain, and one container's growth does slow its neighbours. Since the 1.27 revision, the value for a container is the request plus the throttling factor times the distance between the request and the limit (or node allocatable memory when there is no limit), rounded down to a page. A container with a 512 MiB request, a 1 GiB limit and a factor of 0.9 gets memory.high at about 972.8 MiB. Applied to the documentation's pod-level example with the same factor, the pod cgroup (100 MiB request, 200 MiB limit) gets memory.high at 190 MiB, the container limited to 100 MiB with a 50 MiB request gets 95 MiB, and the container without a limit gets none.

The feature's history is long. It was alpha from 1.22, its beta was cancelled in 1.28 over the livelock described above, it shipped a third alpha in 1.36, and the MemoryQoS gate became beta and enabled by default in 1.371738. The default-on gate changes nothing on its own. In 1.37 memoryThrottlingFactor defaults to nil, which means the kubelet sets no memory.high anywhere, and memoryReservationPolicy defaults to None, which means it sets no memory.min or memory.low34. Operators opt into each half separately. The KEP targets 1.38 for two more reservation policies behind a new alpha gate, NodeMemoryReservationPolicy.

The kubelet fields that decide cgroup v2 memory behaviour. Comments give the v1.37 defaults; the values shown are an example, not a recommendation.yaml
# KubeletConfiguration fragment, Kubernetes v1.37 field names
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
featureGates:
  MemoryQoS: true                       # Beta and on by default since 1.37
memoryThrottlingFactor: 0.9             # default nil: no memory.high at all
memoryReservationPolicy: TieredReservation  # default None: no memory.min or memory.low
singleProcessOOMKill: false             # default on cgroup v2: memory.oom.group=1
# kernelMemcgNotification is left out: on cgroup v2 it is a no-op and eviction stays polled
# Without the merge flag, setting one evictionHard signal sets every other hard threshold to 0,
# which disables nodefs, imagefs and inode eviction (Node-pressure Eviction, hard thresholds)
mergeDefaultEvictionSettings: true      # default false
evictionHard:
  memory.available: "500Mi"             # default 100Mi on Linux; the disk signals keep their defaults

Our position follows from the kernel code. TieredReservation is worth enabling, with one qualification. The scheduler already keeps the sum of requests within allocatable memory, and the kubelet also protects the reserved system cgroups when node allocatable is enforced17. For Guaranteed pods the memory.min they receive holds on both reclaim paths against node pressure: classic reclaim skips a cgroup below its effective min, and shrink_one() rotates it to the young generation without reclaiming it. The memory.low that Burstable pods receive means different things on the two paths. On classic LRU it yields only when no unprotected memory remains. Under MGLRU global reclaim it defers reclaim of the cgroup by one memcg-LRU round (MEMCG_LRU_TAIL), and the lasting effect is the reduced scan pressure from apply_proportional_protection()1819. On MGLRU nodes, which on AKS includes Ubuntu 24.04 and Azure Linux 3.0 node pools, the Burstable half of the policy is therefore an ordering preference, not a reservation. The policy still earns its place there for the hard memory.min it gives Guaranteed pods and the reserved system cgroups, but do not count on memory.low to keep a Burstable pod's requested memory resident under node pressure.

The qualification is KEP-2570's own warning. Under TieredReservation a Guaranteed pod has memory.min equal to memory.max, and the KEP states that page cache then cannot be reclaimed and the pod is OOM-killed when it reaches memory.max17. At the container level the kernel code does not bear that out. A container at its own memory.max is the reclaim target, mem_cgroup_unprotected() drops its own min, and its page cache is reclaimed as it would be without protection7. The warning does hold at the pod cgroup, in a narrower case. Without pod-level resources, ResourceConfigForPod() sets the pod's memory.min to the sum of the container requests, which for a Guaranteed pod equals the sum of their limits. With pod-level resources, PodRequests() returns the request in the pod's own spec.resources, and that is the value written910. Each container of a Guaranteed pod that sets a memory request receives that request as its own memory.min37. When the pod cgroup is the reclaim target, each container is a direct child of the target and keeps its configured min unchanged8, so a container at or below its request is skipped and only what a container holds above its request can be reclaimed. With requests equal to limits and no pod-level resources there is no such excess: every container is at or below its min, the page cache inside the containers is out of reach, and the pod goes to the OOM killer. The route there is the sandbox charge pushing the pod over its limit when no overhead is set.

A pod-level limit set below the sum of the container limits does not reproduce that case. With pod-level resources set, ComputePodQOS() derives the QoS class from spec.resources alone39, so a Guaranteed pod has a pod-level memory request equal to its pod-level limit, and validatePodResourceConsistency() rejects a pod whose pod-level request is below the sum of its container requests40. The container requests then sum to no more than the pod limit, which is below the sum of the container limits, so at least one container has a request below its limit. Page cache that such a container holds above its request stays reclaimable when the pod limit is reached. The pod goes to the OOM killer only when the memory above the containers' requests holds nothing reclaimable, for example when it is anonymous memory and the node has no swap. For a Guaranteed pod with heavy file I/O under this policy, use a RuntimeClass overhead where the runtime's sandbox needs memory of its own. Where a pod-level memory limit is used, size each container's request to the memory it must keep resident rather than to its limit, because only memory above a container's request is open to the pod limit's reclaim.

A throttling factor is a different decision. It converts a crisp OOMKilled with an event in the API into latency with no event at all, and the kernel documentation tells you to pair memory.high with an agent that watches the cgroup. Set a factor only where something reads memory.events high or memory PSI for those containers, and for their pod cgroups where pod-level limits are used, and acts on it.

The lab

Every result above came from one host: Fedora 43 Workstation, kernel 7.2.13-100.fc43.x86_64 with CONFIG_HZ=1000 and 4 KiB pages, 20 CPUs and 62.4 GiB of RAM, systemd 258.11, Python 3.14.8 and coreutils 9.7. The runs use systemd-run --user --scope, which needs no root because the user's systemd instance already has the memory controller enabled for its subtree; MemoryMax=, MemoryHigh= and MemorySwapMax= set memory.max, memory.high and memory.swap.max on the transient scope41. The host has zram swap, so every run sets MemorySwapMax=0 to make anonymous and shmem pages unreclaimable, as on a Kubernetes node without swap.

Two host details affect the output. With systemd's default OOM policy on this host, the scope was stopped as a whole after the first kill, so runs that need to inspect the cgroup afterwards pass OOMPolicy=continue; OOMPolicy=kill is the value that sets memory.oom.group to 135; run 6 reads the file in a scope created with each policy and prints 1 for kill and 0 for continue and stop. Processes in the user session run with oom_score_adj 200, visible in every kernel log line. systemd-oomd also monitors app.slice, which oomctl lists with an 80 percent memory pressure limit over 20 seconds. oomd.conf(5) defines that figure as the share of a 10-second window in which all tasks in the monitored cgroup were delayed42, so it is the full line of app.slice itself that counts, not the line of a scope inside it. Run 2b sampled that line once per second: its full avg10 peaked at 5.44 while the scope's own read 58.05 at the end of the run, because the rest of the desktop session in app.slice kept running. Run 2b never came near the oomd limit.

alloc.py: allocates and writes 1 MiB objects so every page is faulted in and charged.text
# alloc.py: touch anonymous memory in fixed steps and time each step.
import sys, time
step_mib, total_mib = int(sys.argv[1]), int(sys.argv[2])
held, done = [], 0
t0 = time.monotonic()
while done < total_mib:
    t = time.monotonic()
    for _ in range(step_mib):
        held.append(b"\xa5" * (1 << 20))   # 1 MiB, every byte written
    done += step_mib
    print(f"{done:5d} MiB  step {1000*(time.monotonic()-t):8.1f} ms", flush=True)
print(f"held {done} MiB for {time.monotonic()-t0:.1f} s", flush=True)
show.sh: dumps the cgroup's limits, events, pressure and selected memory.stat keys from inside the cgroup.shell
#!/bin/bash
# show.sh: print the memory files of the cgroup this shell runs in.
cg=/sys/fs/cgroup$(cut -d: -f3 /proc/self/cgroup)
echo "cgroup: $cg"
for f in memory.max memory.high memory.swap.max memory.current memory.peak; do
  printf '%-16s %s\n' $f "$(cat $cg/$f)"
done
echo "-- memory.events";   cat $cg/memory.events
echo "-- memory.pressure"; cat $cg/memory.pressure
echo "-- memory.stat (selected)"
grep -E '^(anon|file|shmem|active_file|inactive_file|pgscan|pgsteal|workingset_refault_file) ' $cg/memory.stat
The lab runs, from the directory holding alloc.py and show.sh.shell
mkdir -p /var/tmp/a6lab /tmp/lab
chmod +x show.sh

# 1. Anonymous memory against memory.max
systemd-run --user --scope -p MemoryMax=256M -p MemorySwapMax=0 -p OOMPolicy=continue \
  bash -c 'python3 alloc.py 32 512; echo "exit status $?"; ./show.sh'

# 2. Anonymous memory against memory.high, no hard limit
systemd-run --user --scope -p MemoryHigh=256M -p MemorySwapMax=0 \
  bash -c 'timeout 90 python3 alloc.py 4 296; ./show.sh'

# 2b. Run 2 again while sampling the pressure of app.slice, the cgroup systemd-oomd watches
A=/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/app.slice
( for i in $(seq 1 95); do grep full $A/memory.pressure; sleep 1; done > app_pressure.log ) &
systemd-run --user --scope -p MemoryHigh=256M -p MemorySwapMax=0 \
  bash -c 'timeout 90 python3 alloc.py 4 296; ./show.sh'; wait
cut -d' ' -f2 app_pressure.log | sort -t= -k2 -g | tail -1

# 3. Page cache against memory.max (/var/tmp is btrfs on this host, not tmpfs), six repeats
for i in 1 2 3 4 5 6; do
  systemd-run --user --scope -p MemoryMax=128M -p MemorySwapMax=0 -p OOMPolicy=continue \
    bash -c 'dd if=/dev/zero of=/var/tmp/a6lab/blob bs=1M count=1024 status=none;
             echo "dd exit $?"; ./show.sh'
  rm -f /var/tmp/a6lab/blob
done

# 4. tmpfs against memory.max (/tmp is tmpfs on this host)
systemd-run --user --scope -p MemoryMax=128M -p MemorySwapMax=0 -p OOMPolicy=continue \
  bash -c 'dd if=/dev/zero of=/tmp/lab/shmblob bs=1M count=256 status=none; ./show.sh'
journalctl -k --since -1min | grep -E 'invoked oom|Killed process|rss_anon' -A3

# 5. Group kill: a sleeper and an allocator in one cgroup with memory.oom.group=1
systemd-run --user --scope --unit=lab-group -p MemoryMax=256M -p MemorySwapMax=0 -p OOMPolicy=continue \
  bash -c 'echo 1 > /sys/fs/cgroup$(cut -d: -f3 /proc/self/cgroup)/memory.oom.group;
           sleep 300 & python3 alloc.py 64 512 > /dev/null'
journalctl -k --since -1min | grep -E 'invoked oom-killer|oom_memcg|memory.oom.group|Killed process'

# 5b. Control: the same workload with memory.oom.group left at 0
systemd-run --user --scope --unit=lab-nogroup -p MemoryMax=256M -p MemorySwapMax=0 -p OOMPolicy=continue \
  bash -c 'cat /sys/fs/cgroup$(cut -d: -f3 /proc/self/cgroup)/memory.oom.group;
           sleep 300 & python3 alloc.py 64 512 > /dev/null; echo "python3 exit $?";
           jobs -l; kill %1'
journalctl -k --since -1min | grep -E 'memory.oom.group|Killed process'

# 6. Which OOMPolicy sets memory.oom.group on a scope
for p in kill continue stop; do
  systemd-run --user --scope -q --unit=lab-policy-$p -p OOMPolicy=$p \
    bash -c 'echo "OOMPolicy='$p' memory.oom.group=$(cat /sys/fs/cgroup$(cut -d: -f3 /proc/self/cgroup)/memory.oom.group)"'
done
Lab results on kernel 7.2.13. Byte values are from memory.current, memory.peak and memory.stat; stall time is the memory.pressure total.
RunLimitOutcomememory.eventsStall (µs)Notes
1 anonmax 256 MiBpython3 OOM-killed after 224 MiB of its own allocations, exit status 137max 38, oom 1, oom_kill 1257memory.peak 268,435,456, exactly the limit; victim anon-rss 261,092 kB
2 anonhigh 256 MiBNever killed; ended by timeout after 90 shigh 4,43350,090,3614 MiB steps took about 1.4 ms below the limit, then 611, 2,598, 6,320, 12,688, 16,016 and 32,864 ms; memory.peak 298,528,768
2b anon, repeathigh 256 MiBNever killed; ended by timeout after 90 shigh 4,77352,949,038slowest steps 1,021, 1,869, 7,008, 20,312, 15,976 and 13,769 ms; memory.peak 297,496,576; app.slice full avg10 peak 5.44
3 page cache, six repeatsmax 128 MiBdd of 1 GiB succeeded every timemax 3,566 to 3,599, oom 09,629 to 70,708file 131,334,144 to 132,120,576; active_file 3,670,016 to 67,633,152; inactive_file 63,963,136 to 127,926,272; pgsteal 229,888 to 230,080
4 tmpfsmax 128 MiBbash killed first, then ddnot read: the shell was a victimnot readshmem 131,940,352 on active_anon; 132,497,408-byte file left behind
5 groupmax 256 MiB, oom.group 1python3, bash and sleep all killedgroup kill loggednot readvictim anon-rss 260,872 kB
5b controlmax 256 MiB, oom.group 0only python3 killed, exit status 137one kill loggednot readjobs -l listed sleep 300 still running afterwards
6 policynonememory.oom.group read per OOMPolicynot readnot readkill 1, continue 0, stop 0

Run 2 is the one to repeat on your own hardware. The step times follow the shape of the quadratic in calculate_high_delay(): free below the limit, hundreds of milliseconds per step just above it, and seconds per step once the overage passes a few percent, with each individual sleep capped at two seconds per return to user mode. The process never reached 300 MiB, never received a signal from the kernel, and would have looked to a liveness probe like a slow but working service.

Where the boundaries belong

With the mechanism in view, a few positions follow, each for a stated reason. Set requests equal to limits for containers that use memory-backed volumes or heavy file I/O: tmpfs pages are unreclaimable charges, and active page cache inflates the working set the kubelet evicts on. Under TieredReservation that also makes the pod Guaranteed with memory.min equal to its limit, which is safe while the container limit is the one reached, because the container's own limit reclaim ignores its own protection, and unsafe when the sandbox charge pushes the pod cgroup to its limit first, because every container is then inside its own protection, as described above. A RuntimeClass overhead closes that gap. Give every medium: Memory emptyDir a sizeLimit smaller than the container's limit, so a full volume is an ENOSPC the application can handle rather than an OOM that may kill the wrong process and leaves the volume full. Keep the kubelet's default group kill unless you run a workload that is designed to lose a child.

Alert on oom_kill in memory.events, or on its Kubernetes reflection in container restarts with reason OOMKilled, and alert separately on memory PSI full for pods; the first catches fast failure and the second catches the slow kind that memory.high, reclaim of hot page cache, or an undersized node produces. Size limits from memory.peak and pressure, not from working set averages. And treat memoryThrottlingFactor as a feature you adopt together with its monitor, never alone, because the kernel built memory.high for a world in which something is watching.

Tixraacyada

  1. include/linux/page_counter.h, Linux v7.2 The Linux kernel
  2. Control Group v2 (Documentation/admin-guide/cgroup-v2.rst), Linux v7.2 The Linux kernel
  3. mm/memory.c: folio_prealloc(), alloc_anon_folio(), Linux v7.2 The Linux kernel
  4. mm/filemap.c: filemap_add_folio(), Linux v7.2 The Linux kernel
  5. mm/shmem.c, Linux v7.2 The Linux kernel
  6. mm/memcontrol.c: try_charge_memcg(), __mem_cgroup_handle_over_high(), memory_max_write(), Linux v7.2 The Linux kernel
  7. include/linux/memcontrol.h: MEMCG_CHARGE_BATCH, mem_cgroup_unprotected(), mem_cgroup_below_min(), mem_cgroup_below_low(), Linux v7.2 The Linux kernel
  8. mm/page_counter.c: page_counter_try_charge(), page_counter_calculate_protection(), Linux v7.2 The Linux kernel
  9. pkg/kubelet/cm/helpers_linux.go: ResourceConfigForPod() and ApplyPodLevelMemoryHigh(), Kubernetes v1.37.2 Kubernetes
  10. staging/src/k8s.io/component-helpers/resource/helpers.go: PodRequests(), PodLimits(), Kubernetes v1.37.2 Kubernetes
  11. pkg/features/kube_features.go: PodLevelResources, Kubernetes v1.37.2 Kubernetes
  12. Assign Pod-level CPU and memory resources Kubernetes documentation
  13. pkg/kubelet/cm/pod_container_manager_linux.go: EnsureExists() and applyPodLevelMemoryHigh(), Kubernetes v1.37.2 Kubernetes
  14. mm/internal.h: MAX_RECLAIM_RETRIES, Linux v7.2 The Linux kernel
  15. include/linux/resume_user_mode.h: resume_user_mode_work(), Linux v7.2 The Linux kernel
  16. mm, memcg: reclaim more aggressively before high allocator throttling (commit b3ff92916af3) The Linux kernel
  17. KEP-2570: Support Memory QoS with cgroups v2 Kubernetes SIG Node
  18. mm/vmscan.c: shrink_node(), shrink_node_memcgs(), lru_gen_shrink_node(), shrink_one(), inc_max_seq(), apply_proportional_protection(), Linux v7.2 The Linux kernel
  19. include/linux/mmzone.h: MIN_NR_GENS and the memcg LRU comments, Linux v7.2 The Linux kernel
  20. Multi-Gen LRU (Documentation/admin-guide/mm/multigen_lru.rst), Linux v7.2 The Linux kernel
  21. Azure Kubernetes Service (AKS) node images Microsoft Learn
  22. Ubuntu 24.04 (noble) kernel config annotations: CONFIG_LRU_GEN_ENABLED Ubuntu kernel team
  23. Ubuntu 24.04 (noble) linux-azure kernel config annotations Ubuntu kernel team
  24. Azure Linux 3.0 kernel config: CONFIG_LRU_GEN_ENABLED Microsoft Azure Linux
  25. pkg/kubelet/cm/qos_container_manager_linux.go: Guaranteed pods under the root cgroup, Kubernetes v1.37.2 Kubernetes
  26. Volumes: emptyDir Kubernetes documentation
  27. Resource Management for Pods and Containers Kubernetes documentation
  28. mm/oom_kill.c: oom_badness(), constrained_alloc(), oom_kill_process(), Linux v7.2 The Linux kernel
  29. PSI: Pressure Stall Information (Documentation/accounting/psi.rst), Linux v7.2 The Linux kernel
  30. Understand Pressure Stall Information (PSI) Metrics Kubernetes documentation
  31. Node-pressure Eviction Kubernetes documentation
  32. memory-available-cgroupv2.sh Kubernetes documentation examples
  33. include/linux/mm_inline.h: lru_gen_is_active(), lru_gen_update_size(), Linux v7.2 The Linux kernel
  34. Kubelet Configuration (v1beta1) Kubernetes documentation
  35. systemd.service(5): OOMPolicy= systemd project
  36. pkg/kubelet/eviction/threshold_notifier_linux.go: NewCgroupNotifier(), Kubernetes v1.37.2 Kubernetes
  37. pkg/kubelet/kuberuntime/kuberuntime_container_linux.go: memory.min per container, skipContainerMemoryHigh, Kubernetes v1.37.2 Kubernetes
  38. Feature Gates: MemoryQoS Kubernetes documentation
  39. pkg/apis/core/v1/helper/qos/qos.go: ComputePodQOS(), Kubernetes v1.37.2 Kubernetes
  40. pkg/apis/core/validation/validation.go: validatePodResourceConsistency(), Kubernetes v1.37.2 Kubernetes
  41. systemd.resource-control(5) systemd project
  42. oomd.conf(5): DefaultMemoryPressureLimit= systemd project

Ma cabbiri karnaa sida aad halkan u timid?

Waxaan isticmaalnaa cookies-ka falanqaynta si aan u aragno bogagga shaqeeya iyo xayeysiiska halkan ku keenay. Haddaad diiddo, degelku si la mid ah ayuu u shaqeeyaa, mana dhigno wax cookies falanqayn ah. Siyaasadda cookies-ka