#author("2025-09-11T18:11:49+09:00","default:guest","guest") #author("2025-09-11T18:12:30+09:00","default:guest","guest") *参照元 [#nb0f8385] #backlinks *説明 [#k15629a9] -パス: [[linux-5.15/mm/vmscan.c]] -FIXME: これは何? --説明 **引数 [#s3427218] -pg_data_t *pgdat --メモリノード。 --[[linux-5.15/pg_data_t]] -struct scan_control *sc -- --[[linux-5.15/scan_control]] **返り値 [#r8f231f8] -なし **参考 [#d1fdffc7] *実装 [#x487257f] static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc) { struct mem_cgroup *target_memcg = sc->target_mem_cgroup; struct mem_cgroup *memcg; memcg = mem_cgroup_iter(target_memcg, NULL, NULL); - --[[linux-5.15/mem_cgroup]] --[[linux-5.15/mem_cgroup_iter()]] do { struct lruvec *lruvec = mem_cgroup_lruvec(memcg, pgdat); unsigned long reclaimed; unsigned long scanned; - --[[linux-5.15/mem_cgroup_lruvec()]] /* * This loop can become CPU-bound when target memcgs * aren't eligible for reclaim - either because they * don't have any reclaimable pages, or because their * memory is explicitly protected. Avoid soft lockups. */ cond_resched(); mem_cgroup_calculate_protection(target_memcg, memcg); - --[[linux-5.15/cond_resched()]] --[[linux-5.15/mem_cgroup_calculate_protection()]] if (mem_cgroup_below_min(memcg)) { /* * Hard protection. * If there is no reclaimable memory, OOM. */ continue; - --[[linux-5.15/mem_cgroup_below_min()]] } else if (mem_cgroup_below_low(memcg)) { /* * Soft protection. * Respect the protection only as long as * there is an unprotected supply * of reclaimable memory from other cgroups. */ if (!sc->memcg_low_reclaim) { sc->memcg_low_skipped = 1; continue; } memcg_memory_event(memcg, MEMCG_LOW); - --[[linux-5.15/mem_cgroup_below_low()]] --[[linux-5.15/memcg_memory_event()]] } reclaimed = sc->nr_reclaimed; scanned = sc->nr_scanned; shrink_lruvec(lruvec, sc); shrink_slab(sc->gfp_mask, pgdat->node_id, memcg, sc->priority); - --[[linux-5.15/shrink_lruvec()]] --[[linux-5.15/shrink_slab()]] /* Record the group's reclaim efficiency */ vmpressure(sc->gfp_mask, memcg, false, sc->nr_scanned - scanned, sc->nr_reclaimed - reclaimed); } while ((memcg = mem_cgroup_iter(target_memcg, memcg, NULL))); } - --[[linux-5.15/vmpressure()]] --[[linux-5.15/mem_cgroup_iter()]] *コメント [#oea662d3]