Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1886203iog; Sun, 26 Jun 2022 00:26:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u+ZgWqUyebH5eoZqBz8jISO9x90N6LpVmNGnqPfDEK0IjD7M3WU3DZ+niOfByC/DDCfkPa X-Received: by 2002:a05:6402:2786:b0:435:da07:14cb with SMTP id b6-20020a056402278600b00435da0714cbmr9319559ede.408.1656228366116; Sun, 26 Jun 2022 00:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656228366; cv=none; d=google.com; s=arc-20160816; b=fb4waJnr5PAcwUCxq+ZLQuVOtV1d0Da0XcTt4Eusg2Z+mctHci7nx1ofwZTW+8bCgL bfPOoXHK/FupTUrXwT4XS6KvO6d+8MN1hPwdUYnvjVWQps7Z7MM10DloSK7SLQAtkurH puaB1oWXCQR+djMHnZePAlotTrvh6n9GovXrNTK10Ja8tOLpf/pq+2VRq4u13PEI26pw LmZB1JK4yv+BVNvkl3Qbk8YHM5q8mwwONGHjniqdbAHTuek0dH0WZBdlyWdwLAJRbh9y BQN/ebvoYyiuFlm9i1A5XzgB2vvpGXUYhIDQuU2fyPvxxnRAgo3jagzBfL1FHrt7XjCD ++/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=IBedsG9Q5xgkDI4Di1vJ798mBW+tiuIsna2FmqI3oz8=; b=xXoJFicmmNNDXc7XYXrkMIWslF9F+ibhCTI4TkrD3DuOF2/hRdgT3+eJ0QOzu6laS+ YyIBlJJ1Jni1bQI2CvKhDZg/iCGPDvKi2VCl5C4v8QkX+d2XbNExoqGL1CHMF6UTh0GQ J/2gjQNdF3ebAN1gR8DLJNsh658J+RPI+d9IYczbaU619mWAYhlGWU79lHvLts/lwjfH qzflZBbYxlV30cNyYvkTduCkXCjNIxChKDiPgTwd1GGyOljV5E7Y0WFvvBiCm/KK6q6P rEIIvYmylhaKu+G0am+1l3/4A7YfBn2Lf+gjQCBI+BvIa+SajIa/BlMz6FzG87rxUSLc 1epg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=BROfm7Vb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a17090663d100b00711c9e99bdbsi7370885ejk.258.2022.06.26.00.25.17; Sun, 26 Jun 2022 00:26:06 -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=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=BROfm7Vb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232734AbiFZHLh (ORCPT + 99 others); Sun, 26 Jun 2022 03:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbiFZHLf (ORCPT ); Sun, 26 Jun 2022 03:11:35 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C93113DC5 for ; Sun, 26 Jun 2022 00:11:34 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id z21so11382359lfb.12 for ; Sun, 26 Jun 2022 00:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=IBedsG9Q5xgkDI4Di1vJ798mBW+tiuIsna2FmqI3oz8=; b=BROfm7VbE1SLLJAAQRbRMYSFFuYVMx32Rq+TL06HlNfW5yYfeyzp7rFodfTjhMjslf 0kC1417O0TcfoXi1Kqm4Gt20jySLwoxrWnqXsZUbwc6hInzvpw4nSCdGJOPaVRItWqO4 J8qLBhnW1aIyqh8xBUjsDdMn3k0mfnUqDgSj7zSiqU3iHUOp7lOBno8nMLR8CbxLOACn f61afhZ2Ix88+32NTl/aBBhRUibW0rTfgoY4jnRvVHf6inQrRlyQpYJEiRBTUA2mmDkf 4i/mRGDfvXof4eGvNcvi1Jpo9sBrvqsSwZVMzm2uGpOwcABIac+++DEDXAsWzuaol1lu lkKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=IBedsG9Q5xgkDI4Di1vJ798mBW+tiuIsna2FmqI3oz8=; b=TA0aR+RbLJpn3oV+IeBHlsM3asVghBD7SrZaaMXhuSrczs4A5dNKtx3/AeXjbszq3p y28usMCUSlsgD8wvr//mUO0FfmiaT4ijRkIOQz69A0fNkqINHHzExBt5cuqHEeycG0yR 5kNX5oeGa3bCRgSpxXDI3v5ACuHCDD4zPT33oaTFdn+XPi0IiSaLgL3F3Im2ItDjIjMr xjIusAc1rzL2ooCydFGxl61sLT5azraI+lhOagdkft+SSoY1w8ZdvTuPU9rF8PrXe8UO 3afVtiyVLm0euL4QUwFNv7PW/7qIw86I7agf7WC5Syd4BM5EIi3UziRJukhcfU0KIM0K WOKA== X-Gm-Message-State: AJIora//3IBfQxWVHa0AKxHSS8MQUu9jsAY0oHfJQyiv1/WH2Ny4jpGO L23t/1laIMvn2Qw2JAJztrym+g== X-Received: by 2002:a05:6512:22c1:b0:479:54b6:8281 with SMTP id g1-20020a05651222c100b0047954b68281mr5076178lfu.291.1656227492453; Sun, 26 Jun 2022 00:11:32 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.129]) by smtp.gmail.com with ESMTPSA id b22-20020a056512305600b0047da6e495b1sm1246277lfb.4.2022.06.26.00.11.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jun 2022 00:11:32 -0700 (PDT) Message-ID: <186d5b5b-a082-3814-9963-bf57dfe08511@openvz.org> Date: Sun, 26 Jun 2022 10:11:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH RFC] memcg: notify about global mem_cgroup_id space depletion Content-Language: en-US To: Roman Gushchin Cc: Shakeel Butt , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Michal Hocko , kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Vlastimil Babka , Muchun Song , cgroups@vger.kernel.org References: From: Vasily Averin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 6/26/22 04:56, Roman Gushchin wrote: > On Sat, Jun 25, 2022 at 05:04:27PM +0300, Vasily Averin wrote: >> Currently host owner is not informed about the exhaustion of the >> global mem_cgroup_id space. When this happens, systemd cannot >> start a new service, but nothing points to the real cause of >> this failure. >> >> Signed-off-by: Vasily Averin >> --- >> mm/memcontrol.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index d4c606a06bcd..5229321636f2 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -5317,6 +5317,7 @@ 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; >> + pr_notice_ratelimited("mem_cgroup_id space is exhausted\n"); >> goto fail; >> } > > Hm, in this case it should return -ENOSPC and it's a very unique return code. > If it's not returned from the mkdir() call, we should fix this. > Otherwise it's up to systemd to handle it properly. > > I'm not opposing for adding a warning, but parsing dmesg is not how > the error handling should be done. I'm agree, I think it's a good idea. Moreover I think it makes sense to use -ENOSPC when the local cgroup's limit is reached. Currently cgroup_mkdir() returns -EAGAIN, this looks strange for me. if (!cgroup_check_hierarchy_limits(parent)) { ret = -EAGAIN; goto out_unlock; } Thank you, Vasily Averin