Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1753186iog; Sat, 25 Jun 2022 19:14:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sK2Dqs+KwRWrXzL1WqZcpCe3etDMCYNPuFlFsu95IcFvMdl21HOXGV48vzWmWJT0ZTi7GO X-Received: by 2002:a17:906:8292:b0:723:5473:b2cf with SMTP id h18-20020a170906829200b007235473b2cfmr6166774ejx.378.1656209648486; Sat, 25 Jun 2022 19:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656209648; cv=none; d=google.com; s=arc-20160816; b=jU8TiPN7ZSx2pcGCzVxojtKByGuxPAv4JrgQ0/AFsYSAhUlEqNlbPhPoh89w8vTZ/F FNJSuv2gSPkzlFdGQv+NnwobusOeXUOTiBB9/FuvmhScPW2X46rukM1B3TG1cyMgpfZk McKDP241EwS15DNALjMv2f4urlQYVTBmf2JnjPOUwIDoO6U1qh59tG2MV9V+J+pfId14 FRUd1FMGI7/oz5d35/8wOS961bXLwAqL29Z7ns1+BJQyoOC+e7wR2h8xFzH81JeYIHFM e43Rw9jG4c5lRkE9fNz7z9PtGMBB3cbdBJ9VhVviM9P/QT1WR34uQSufTQReF2w1koMt IEXA== 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=bjZI8DTIvucVtX5WQZE5x3xoKYG/ekTnBVDG7567Nww=; b=T/Rqr9EdqMO9N7LwQy+IiQRTnnRnzzX7j6WJz5H4WJWcxEDtSBhm9NWEHYYkcZ8iRQ F8BeLICTk9zhEyEuC8bfQ+41AGv4P5SjnmaIT6ktEy0/lFtO7GnPisTcwHv4Q8KTU02k pW6aRnQpZigiLdsDh938eLbuH8I2iU97NMDEnSfAbIPS61TCpZZsDCx25XYEAnDW3IRn Qa+a2XWuO3/xUADCnwFb18cHjSKZOD3mAdIlb7GS+hQKN2m/GCjIF9ULS4chKpsz74Yl bOTgAZujvReBDVcklqTMHrB9z/UrJLiY9w7Q3AJ4RKFd7Q7PLdDCQOZ4uPjuKmCgZrKI wftA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="vBWYqIw/"; 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 x25-20020aa7d6d9000000b0043559d8c6a6si8077260edr.186.2022.06.25.19.13.43; Sat, 25 Jun 2022 19:14:08 -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="vBWYqIw/"; 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 S233777AbiFZB4O (ORCPT + 99 others); Sat, 25 Jun 2022 21:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233613AbiFZB4N (ORCPT ); Sat, 25 Jun 2022 21:56:13 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 966F913CF6; Sat, 25 Jun 2022 18:56:12 -0700 (PDT) Date: Sat, 25 Jun 2022 18:56:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656208570; 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=bjZI8DTIvucVtX5WQZE5x3xoKYG/ekTnBVDG7567Nww=; b=vBWYqIw/oxs4LrYOucwfyC44hX5VSaebHW971hVyDMn4SEhSuSadnHtg1E+KN4TGyCzs+z F3S9YtDszUv1h9nslGbXgumAJzW5MRY9w5oYa8exaPjre30t7l24VyPOJ07n3IC4FsnYVH qgisoDutY8/3V8XvFjIsNgz7E4Ru4eU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Vasily Averin Cc: Shakeel Butt , Michal =?iso-8859-1?Q?Koutn=FD?= , Michal Hocko , kernel@openvz.org, linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Vlastimil Babka , Muchun Song , cgroups@vger.kernel.org Subject: Re: [PATCH RFC] memcg: notify about global mem_cgroup_id space depletion Message-ID: References: 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 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. Thanks!