Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3785557iog; Tue, 28 Jun 2022 02:45:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvzpB5Gzu/HC6Rxyb8Ui5yMA9JMsNfToOsZe1LeaB18RJjVwD87Jq6bPnGctgnYcWoTwzY X-Received: by 2002:a05:6a00:1c5c:b0:505:7469:134a with SMTP id s28-20020a056a001c5c00b005057469134amr3888647pfw.16.1656409531816; Tue, 28 Jun 2022 02:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656409531; cv=none; d=google.com; s=arc-20160816; b=ujdfv41n8snWqphmvqBEsE8m7FE4VSuP6UXGtsFSL4JGPvuBOFoINRCHur9e1UtUzf xixTXUiz6RloNZiyQFDz95ntvO9tr4MkNvzSqEaPPmjZi4JStC3LWPPz5HaX9lbfHonq jEpMxjX7LO5yRrMc27sGay2YJFEJMEgsnzs8FAPDcaMIk8yHXSl92ILYwluLSYpYWjSQ 5ilOVYy05hQw11VKNVAbCuqmUfpiMtJZAEiXTqXu/aB9O1seyjbvTTCNrU+afCg9wk53 jIp0jIPQZa7bMSIehxYXa6HUyhumLCnT75DtAINKQjtmEpoKZBrGpoBnYj/AgA0tYXve rPKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=z/CFWoysazPYOJ+RT+MoOQfwRcysVEsHRQF675n1OGQ=; b=hzjVR11W7RKOUHpG3QWgwDUotWlgVMYd7aGi9MDbTmavkXs0KX672gtnjMZYfrPx4F mKufNOYTgmvVKTRQ/oZ2Bf/aQQiIZCgtcWTMb1eWqldDUGOOEZFW+2pBxTfuMz+ZC0JA ijhd1Uh2d7qor1IvXjRxTvnNpoA4TNRQpQ2l7CIdFcFY/5CXypEGZZUcMbqUxE8XEnXT LqhMdtCsgib+3m15koX8bBq5muEY6N3MgI+bQqxqHKqNFWqqlRc3jIfKCzPLTO66eDiv 9eJcZQ/+Ms8/HUI3zF40wrElm6XetlrMv8lQXxbNN4PTNs2d6UqyW3wMErRn+4VAjPzz rxDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=JANHdKn0; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a17090301cd00b0016a33e4419fsi15066980plh.11.2022.06.28.02.45.20; Tue, 28 Jun 2022 02:45:31 -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=@suse.com header.s=susede1 header.b=JANHdKn0; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344056AbiF1JIZ (ORCPT + 99 others); Tue, 28 Jun 2022 05:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234062AbiF1JIW (ORCPT ); Tue, 28 Jun 2022 05:08:22 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1660B766F; Tue, 28 Jun 2022 02:08:22 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id C89A51F9D9; Tue, 28 Jun 2022 09:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1656407300; h=from:from:reply-to: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=z/CFWoysazPYOJ+RT+MoOQfwRcysVEsHRQF675n1OGQ=; b=JANHdKn0mmgpP88tAVTqM1LNjgntd0zv2uCWTJynSPXs4KRj2VMbaxE1WDbZpQZfBDRBC7 /GxsxqrefLx2qwvL6P8kRKQJWWWolvM97j34XoT+6tfkvvfSzrs8eHKiO+zd0BJYf5cxEi LyXDetrh6tArsfPoS7eKN7rW3YmjliA= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8D158139E9; Tue, 28 Jun 2022 09:08:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wxFzIQTFumKKQAAAMHmgww (envelope-from ); Tue, 28 Jun 2022 09:08:20 +0000 Date: Tue, 28 Jun 2022 11:08:19 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Roman Gushchin Cc: Vasily Averin , Muchun Song , Shakeel Butt , 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: <20220628090819.GB30543@blackbody.suse.cz> 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: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, 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 06:11:27PM -0700, Roman Gushchin wrote: > 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. This sounds like a good generalization. > 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. Just mind there's a difference between events: what cgroup's limit was hit and what cgroup was affected by the limit [1] (the former is more useful for the calibration if I understand the situation). Michal [1] https://lore.kernel.org/all/20200205134426.10570-2-mkoutny@suse.com/