mm/memcontrol.c

Source file repositories/reference/linux-study-clean/mm/memcontrol.c

File Facts

System
Linux kernel
Corpus path
mm/memcontrol.c
Extension
.c
Size
160768 bytes
Lines
6069
Domain
Core OS
Bucket
Memory Management
Inferred role
Core OS: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

subsys_initcall(mem_cgroup_swap_init);

#endif /* CONFIG_SWAP */

void mem_cgroup_node_filter_allowed(struct mem_cgroup *memcg, nodemask_t *mask)
{
	nodemask_t allowed;

	if (!memcg)
		return;

	/*
	 * Since this interface is intended for use by migration paths, and
	 * reclaim and migration are subject to race conditions such as changes
	 * in effective_mems and hot-unpluging of nodes, inaccurate allowed
	 * mask is acceptable.
	 */
	cpuset_nodes_allowed(memcg->css.cgroup, &allowed);
	nodes_and(*mask, *mask, allowed);
}

void mem_cgroup_show_protected_memory(struct mem_cgroup *memcg)
{
	if (mem_cgroup_disabled() || !cgroup_subsys_on_dfl(memory_cgrp_subsys))
		return;

	if (!memcg)
		memcg = root_mem_cgroup;

	pr_warn("Memory cgroup min protection %lukB -- low protection %lukB",
		K(atomic_long_read(&memcg->memory.children_min_usage)),
		K(atomic_long_read(&memcg->memory.children_low_usage)));
}

Annotation

Implementation Notes