From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D4BAC43334 for ; Tue, 28 Jun 2022 01:11:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9AFF8E0002; Mon, 27 Jun 2022 21:11:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4AE68E0001; Mon, 27 Jun 2022 21:11:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C13058E0002; Mon, 27 Jun 2022 21:11:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B19F48E0001 for ; Mon, 27 Jun 2022 21:11:37 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 72CFE61190 for ; Tue, 28 Jun 2022 01:11:37 +0000 (UTC) X-FDA: 79625867034.19.132AD7D Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf12.hostedemail.com (Postfix) with ESMTP id AFBF74002A for ; Tue, 28 Jun 2022 01:11:36 +0000 (UTC) Date: Mon, 27 Jun 2022 18:11:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656378694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YbAB+AoVXroNpmpQFJ1qGl0KAbzmB7jFbqYqTflBFEw=; b=pv5TxXqtLD0K6CpbRL57lY3eKgfQ9sx4fBnWSf/YrOj9CeZLJyHnNZtHHtnnYuua9GW8JU sWKoqyZvKK7A0mzMw7Xh1pT6tb29Ywaa+hW5U6BM4DBqRzCf80ylUYigpLiqnNUINEBBzl 0BMWVmWtCU/jT/KKf5iR8WDVSLkm2es= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Muchun Song , Shakeel Butt , Michal =?iso-8859-1?Q?Koutn=FD?= , Michal Hocko , kernel@openvz.org, LKML , Andrew Morton , Linux Memory Management List , Vlastimil Babka , Cgroups Subject: Re: [PATCH mm v2] memcg: notify about global mem_cgroup_id space depletion Message-ID: References: <97bed1fd-f230-c2ea-1cb6-8230825a9a64@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=pv5TxXqt; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656378697; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YbAB+AoVXroNpmpQFJ1qGl0KAbzmB7jFbqYqTflBFEw=; b=T96ZykkbrxeXuSCRKgNzLJ3LD76FPEzllqlN/Mdya/cRd/lyjo1eTLHnC/7cP6/U5qRCyx hMId6hgOhDfcWYAm1nk9zVArueTOn+YmY2omR1dtzW6xgPaNU0eaMK8xIWqxYM7k/XZhWA DBFnKEZzIVopx5JDfbS//Ega8gPeZjY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656378697; a=rsa-sha256; cv=none; b=qsCupfY2LBvdhZQ9pEQPtzgHfomxe6WfFIYKFNcF4hSCkZ34uthxYek8TJX9cIJK+EOqVI ilZSjIlDOweSWc/NfwjSro/bYxs7dcZPuLwlDi/9eLcc2TkSdZn7wVGHJ03EDBLLyPMPFs nNULRCQtztYzKqCc6jjMYZk0DaF1Rws= X-Stat-Signature: utwwkqqpfpfjg99gbx66ukcyz4w956xf X-Rspamd-Queue-Id: AFBF74002A Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=pv5TxXqt; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf12.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1656378696-459345 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 27, 2022 at 09:49:18AM +0300, Vasily Averin wrote: > On 6/27/22 06:23, Muchun Song wrote: > > If the caller can know -ENOSPC is returned by mkdir(), then I > > think the user (perhaps systemd) is the best place to throw out the > > error message instead of in the kernel log. Right? > > Such an incident may occur inside the container. > OpenVZ nodes can host 300-400 containers, and the host admin cannot > monitor guest logs. the dmesg message is necessary to inform the host > owner that the global limit has been reached, otherwise he can > continue to believe that there are no problems on the node. Why this is happening? It's hard to believe someone really needs that many cgroups. Is this when somebody fails to delete old cgroups? I wanted to say that it's better to introduce a memcg event, but then I realized it's probably not worth the wasted space. Is this a common scenario? I think a better approach will be to add a cgroup event (displayed via cgroup.events) about reaching the maximum limit of cgroups. E.g. cgroups.events::max_nr_reached. Then you can set cgroup.max.descendants to some value below memcg_id space size. It's more work, but IMO it's a better way to communicate this event. As a bonus, you can easily get an idea which cgroup depletes the limit. Thanks!