From: Vasily Averin Date: Mon, 27 Jun 2022 02:11:26 +0000 (+0300) Subject: memcg: notify about global mem_cgroup_id space depletion X-Git-Tag: howlett/maple/20220722_2~54 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=66799b771b614cfb828fea309dfde9e490e4b907;p=users%2Fjedix%2Flinux-maple.git memcg: notify about global mem_cgroup_id space depletion Currently, the host owner is not informed about the exhaustion of the global mem_cgroup_id space. When this happens, systemd cannot start a new service and receives a unique -ENOSPC error code. However, this can happen inside this container, persist in the log file of the local container, and may not be noticed by the host owner if he did not try to start any new services. Link: https://lkml.kernel.org/r/97bed1fd-f230-c2ea-1cb6-8230825a9a64@openvz.org Signed-off-by: Vasily Averin Cc: Shakeel Butt Cc: Roman Gushchin Cc: Michal Koutný Cc: Michal Hocko Cc: Vlastimil Babka Cc: Muchun Song Signed-off-by: Andrew Morton --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 956b82ec8f73..0fb880dd25d1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5175,6 +5175,8 @@ static struct mem_cgroup *mem_cgroup_alloc(void) 1, MEM_CGROUP_ID_MAX + 1, GFP_KERNEL); if (memcg->id.id < 0) { error = memcg->id.id; + if (error == -ENOSPC) + pr_notice_ratelimited("mem_cgroup_id space is exhausted\n"); goto fail; }