Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3524817iog; Mon, 27 Jun 2022 18:54:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1smnktQSvOYaInlJs7jKZ8xbQo0OEsUe7a+7TvRR5PudIepGzFqM5/dFv2RCTQkFfOkFcRb X-Received: by 2002:a17:902:dac8:b0:16a:4bc2:ebc5 with SMTP id q8-20020a170902dac800b0016a4bc2ebc5mr1127089plx.19.1656381253851; Mon, 27 Jun 2022 18:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656381253; cv=none; d=google.com; s=arc-20160816; b=IYgXLEXOHk45ad12CmQRJ4ffNzu5tGJjDOehhT8HgCA/X7Pcxw/0ZD3UdWWJpogu5b vGPbcjVUazoqU7xxtQ5fODNBC0GLW7CDDA30R23SrdYuJxi/E41KuNJynM0QRmXK4dCl ktWuE8YGhjM1oAxey0Tm6iuWMIft5H6sNSDVtSIaBPQrb1xuT8PXbZzgviy8fIbs8dV1 EoI991cBpL8JAmAP6j3sC48lNeRYrFWZjrOAu7xG/r4Fd6Rxb+e7N7MdofPYwsIWI7g4 HNhGpIjyKrOAbjkoLpI6R8QVNIb3sPlhu7SAFPLsoKQSaJGUxCNDQBVlYAaWraYtB3PY qgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=YbAB+AoVXroNpmpQFJ1qGl0KAbzmB7jFbqYqTflBFEw=; b=oN0zaOeLaBzQQkfuxK2dpGvCEyrp6rQso4sL8iHVYuEIhzs9Rr9FEylo9cF8kkbsFn ZSH6Ewc2Rl4e2SZS2YlZ4KlKcBzaoADZ0mEz62jlNCR7V1sk0bed5PAKX2pkFoDedJbm NQRtDm8R3/wQd2uCEBWeXSOHgRNf29SpORZO5PY780c+1MtM/34R9HtLAXFSS/2cWL3t 9JcIAVfgLLLjGwhoF0P4GpNEtF4MfCHQPTX6HV0lHzgtMGsCdLTEeNeO40RdDW1MaCVC SHR18fw94lzFMwcg+cQCu6zY6J3bdrxVmUZ9P0oBiwwJ6XZTGeXmreZaCbhXdo8fVboo /nFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=pv5TxXqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s32-20020a635260000000b00408c9608148si15438104pgl.488.2022.06.27.18.54.01; Mon, 27 Jun 2022 18:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=pv5TxXqt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242910AbiF1BLi (ORCPT + 99 others); Mon, 27 Jun 2022 21:11:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241624AbiF1BLh (ORCPT ); Mon, 27 Jun 2022 21:11:37 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F7922252C; Mon, 27 Jun 2022 18:11:36 -0700 (PDT) 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!